Hi,

these patches solve some of the 'redundant assignment to self' warnings.
Released under LGPLv3

-- Kenneth
From 29ee756d84415238dbbd4785dc6d7f4d2b0be296 Mon Sep 17 00:00:00 2001
From: Kenneth Venken <kenneth.ven...@gmail.com>
Date: Tue, 25 Jan 2011 18:39:18 +0100
Subject: [PATCH] Cpp cleanliness: redundant assignment to self

---
 .../languagepacks/lngpckinsthelper.cxx             |    3 +--
 .../source/dialogs/digitalsignaturesdialog.cxx     |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
index fa5c389..3feef75 100644
--- a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
+++ b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
@@ -153,9 +153,8 @@ extern "C" UINT __stdcall SetProductInstallationPath(MSIHANDLE handle)
             MsiSetProperty(handle, TEXT("INSTALLLOCATION"), path.c_str());                        
         }        
     }
-    catch(std::runtime_error& ex)
+    catch(std::runtime_error&)
     {
-        ex = ex; // no warnings
     }                                       
     return ERROR_SUCCESS;    
 }
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index dca6489..1095c22 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -687,7 +687,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
             else if (meSignatureMode == SignatureModeMacros
                 && bSigValid && bCertValid)
             {
-                aImage = aImage = maSigsValidImg.GetImage();
+                aImage = maSigsValidImg.GetImage();
             }
             
             SvLBoxEntry* pEntry = maSignaturesLB.InsertEntry( aNullStr, aImage, aImage );
-- 
1.7.1

From 11efdcc71d111202f7baa5759e75009c14d26e4b Mon Sep 17 00:00:00 2001
From: Kenneth Venken <kenneth.ven...@gmail.com>
Date: Tue, 25 Jan 2011 18:39:27 +0100
Subject: [PATCH] Cpp cleanliness: redundant assignment to self

---
 editeng/source/rtf/rtfgrf.cxx                      |    2 --
 .../source/win32/filepicker/workbench/Test_fps.cxx |    3 +--
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx
index 6838896..46201c5 100644
--- a/editeng/source/rtf/rtfgrf.cxx
+++ b/editeng/source/rtf/rtfgrf.cxx
@@ -424,7 +424,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
             if (rPicType.uPicLen)
             {
                 ULONG nPos = rStrm.Tell();
-                nPos = nPos;
                 rStrm.SeekRel(-1);
                 sal_uInt8 aData[4096];
                 ULONG nSize = sizeof(aData);
@@ -441,7 +440,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
                 nNextCh = GetNextChar();
                 bValidBmp = !pTmpFile->GetError();
                 nPos = rStrm.Tell();
-                nPos = nPos;
             }
             break;
         case RTF_PICSCALEX:			rPicType.nScalX = nVal; break;
diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
index 8c66df5..1505006 100644
--- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
+++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
@@ -196,9 +196,8 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star::
             }
         }        
     }
-    catch( IllegalArgumentException& ex )
+    catch( IllegalArgumentException&  )
     {
-        ex = ex;
     }
 }
 
-- 
1.7.1

From 68b8a36e4dddaea792cdc940fb814463bc567ef1 Mon Sep 17 00:00:00 2001
From: Kenneth Venken <kenneth.ven...@gmail.com>
Date: Tue, 25 Jan 2011 18:39:32 +0100
Subject: [PATCH] Cpp cleanliness: redundant assignment to self

---
 unotools/source/config/moduleoptions.cxx |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 1d7648b..37039e3 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -310,9 +310,9 @@ struct FactoryInfo
         //---------------------------------------------------------------------------------------------------------
         void setIcon( sal_Int32 nNewIcon )
         {
-            if( nNewIcon != nNewIcon )
+            if( nIcon != nNewIcon )
             {
-                nNewIcon     = nNewIcon;
+                nIcon        = nNewIcon;
                 bChangedIcon = sal_True;
             }
         };
-- 
1.7.1

From 986f4bfdfbbcb7adcb2a0537277ae999bf0c3380 Mon Sep 17 00:00:00 2001
From: Kenneth Venken <kenneth.ven...@gmail.com>
Date: Tue, 25 Jan 2011 18:39:38 +0100
Subject: [PATCH] Cpp cleanliness: redundant assignment to self

---
 sal/osl/w32/diagnose.c      |    6 ++----
 sal/osl/w32/file_dirvol.cxx |   12 +++---------
 sal/osl/w32/module.cxx      |    6 ++----
 sal/osl/w32/socket.cxx      |    6 ++----
 sal/osl/w32/util.c          |    3 +--
 5 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c
index caf511a..48a57d7 100644
--- a/sal/osl/w32/diagnose.c
+++ b/sal/osl/w32/diagnose.c
@@ -161,10 +161,10 @@ sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nL
             return sal_True;    /* will cause oslDebugBreak */
     }
 #endif /* NO_DEBUG_CRT */
-    return sal_False;  /* not shure, not care */
+    return sal_False;  /* not sure, don't care */
 }
 
-sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage)
+sal_Int32 SAL_CALL osl_reportError(sal_uInt32 /*nType*/, const sal_Char* pszMessage)
 {
     UINT nFlags;
     int nDisposition;
@@ -173,8 +173,6 @@ sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage)
     HWND hWndParent = GetActiveWindow();
     if (hWndParent != NULL)
         hWndParent = GetLastActivePopup(hWndParent);
-
-    nType = nType; /* avoid warnings */
     
     /* set message box flags */
     nFlags = MB_TASKMODAL | MB_ICONERROR | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND;
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index 85d067f..fe63d19 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -844,7 +844,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString *strDirectoryPath, oslDirect
 
 //#####################################################
 static oslFileError SAL_CALL osl_getNextNetResource( 
-    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 uHint )
+    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 /*uHint*/ )
 {
     Directory_Impl		*pDirImpl = (Directory_Impl *)Directory;
     DirectoryItem_Impl	*pItemImpl = NULL;
@@ -852,8 +852,6 @@ static oslFileError SAL_CALL osl_getNextNetResource(
     LPNETRESOURCEW		lpNetResource = (LPNETRESOURCEW)buffer;
     DWORD				dwError, dwCount, dwBufSize;
 
-    uHint = uHint; /* to get no warning */        	    
-
     if ( !pItem )
         return osl_File_E_INVAL;
     *pItem = NULL;
@@ -892,13 +890,11 @@ static oslFileError SAL_CALL osl_getNextNetResource(
 
 //##################################################### 
 static oslFileError SAL_CALL osl_getNextDrive( 
-    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 uHint )
+    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 /*uHint*/ )
 {
     Directory_Impl		*pDirImpl = (Directory_Impl *)Directory;
     DirectoryItem_Impl	*pItemImpl = NULL;
     BOOL				fSuccess;
-
-    uHint = uHint; /* avoid warnings */
                 
     if ( !pItem )
         return osl_File_E_INVAL;
@@ -936,14 +932,12 @@ static oslFileError SAL_CALL osl_getNextDrive(
 
 //##################################################### 
 static oslFileError SAL_CALL osl_getNextFileItem( 
-    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 uHint)
+    oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 /*uHint*/)
 {
     Directory_Impl		*pDirImpl = (Directory_Impl *)Directory;
     DirectoryItem_Impl	*pItemImpl = NULL;
     BOOL				fFound;
 
-    uHint = uHint; /* avoid warnings */
-                
     if ( !pItem )
         return osl_File_E_INVAL;
     *pItem = NULL;
diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx
index 11461af..1c35135 100644
--- a/sal/osl/w32/module.cxx
+++ b/sal/osl/w32/module.cxx
@@ -46,7 +46,7 @@
 /*****************************************************************************/
 /* osl_loadModule */
 /*****************************************************************************/
-oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode )
+oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 /*nRtldMode*/ )
 {
     HINSTANCE hInstance;
 #if OSL_DEBUG_LEVEL < 2
@@ -59,9 +59,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod
     RTL_LOGFILE_TRACE1( "{ osl_loadModule start: %S", (LPTSTR)&strModuleName->buffer );
 
     OSL_ASSERT(strModuleName);
-
-    nRtldMode = nRtldMode; /* avoid warnings */
-    
+   
     nError = osl_getSystemPathFromFileURL(strModuleName, &Module);
 
     if ( osl_File_E_None != nError )
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index e758fdc..b53d25f 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -308,9 +308,9 @@ static oslSocketDialupImpl* __osl_createSocketDialupImpl (void)
  */
 static void __osl_initSocketDialupImpl (oslSocketDialupImpl *pImpl)
 {
-#ifdef SOCKET_USE_AUTODIAL
     if (pImpl)
     {
+#ifdef SOCKET_USE_AUTODIAL
         HINSTANCE hModule;
 
         EnterCriticalSection (&pImpl->m_hMutex);
@@ -330,10 +330,8 @@ static void __osl_initSocketDialupImpl (oslSocketDialupImpl *pImpl)
         }
 
         LeaveCriticalSection (&pImpl->m_hMutex);
-    }
-#else
-    pImpl = pImpl; /* avoid warnings */
 #endif
+    }
 }
 
 /*
diff --git a/sal/osl/w32/util.c b/sal/osl/w32/util.c
index 2687683..4a1a11f 100644
--- a/sal/osl/w32/util.c
+++ b/sal/osl/w32/util.c
@@ -30,9 +30,8 @@
 
 
 
-extern sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 *pAddr )
+extern sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8* /*pAddr*/ )
 {
-    pAddr = pAddr; /* avoid warnings */
     return sal_False;   
 }
 
-- 
1.7.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to