On Fri, 15 Apr 2011 16:25:32 -0300, Kayo Hamid <kayo.ha...@gekkolinux.com.br> wrote:
Just variableScope, sending for review.


Sometimes it happens ;-) patch annexed

revol_
diff --git a/vcl/os2/source/app/printf.c b/vcl/os2/source/app/printf.c
index 06e75b6..9c65147 100644
--- a/vcl/os2/source/app/printf.c
+++ b/vcl/os2/source/app/printf.c
@@ -139,7 +139,6 @@ int debug_printf(const char *f, ...)
   PIB    *ppib;                    /* .. */
   TID    ourtid;                   /* thread ID */
   struct perthread *tp;            /* pointer to per-thread data */
-  int    rc;                       /* returncode */
   ULONG  urc;                      /* returncode */
 
   urc=DosOpenQueue(&servepid, &qhandle, PRINTFQNAME);  /* Open the Q */
@@ -192,6 +191,7 @@ int debug_printf(const char *f, ...)
     /* taking note of certain control characters and sending a line   */
     /* the queue whenever we see a LF control, or when the line       */
     /* fills (causing a forced break).                                */
+    int    rc;                       /* returncode */
     for (i=0; ; i++) {
       ch=buffer[i]; if (!ch) break;
       switch(ch) {
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 609d48e..9de5860 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -4750,14 +4750,12 @@ static int ImplHandleMinMax( HWND hWnd, LPARAM lParam )
 // if bByPosition is FALSE then nPos denotes a menu id instead of a position
 static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, sal_Bool bByPosition=TRUE )
 {
-    DWORD err=0;
-
     MENUITEMINFOW mi;
     memset(&mi, 0, sizeof(mi));
     mi.cbSize = sizeof( mi );
     mi.fMask = MIIM_DATA;
     if( !GetMenuItemInfoW( hMenu, nPos, bByPosition, &mi) )
-        err = GetLastError();
+       DWORD err = GetLastError();
 
     return (WinSalMenuItem *) mi.dwItemData;
 }
@@ -4765,8 +4763,6 @@ static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, sal_Bool bByP
 // returns the index of the currently selected item if any or -1
 static int ImplGetSelectedIndex( HMENU hMenu )
 {
-    DWORD err=0;
-
     MENUITEMINFOW mi;
     memset(&mi, 0, sizeof(mi));
     mi.cbSize = sizeof( mi );
@@ -4777,7 +4773,7 @@ static int ImplGetSelectedIndex( HMENU hMenu )
         for(int i=0; i<n; i++ )
         {
             if( !GetMenuItemInfoW( hMenu, i, TRUE, &mi) )
-                err = GetLastError();
+                DWORD err = GetLastError();
             else
             {
                 if( mi.fState & MFS_HILITE )
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to