From 7a93c19ebe580e2d1286112bb5ba05e969320ad2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 2 Jul 2014 13:02:19 +0200 Subject: binfile: remove unused local variables gcc 4.9 warns about the unused local variables. sizeof() does not need real variables, so use a casted NULL pointer instead and get rid of the variables and the warning. --- src/sysync/binfileimplclient.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/sysync/binfileimplclient.cpp b/src/sysync/binfileimplclient.cpp index 961e014..5d9c7d3 100755 --- a/src/sysync/binfileimplclient.cpp +++ b/src/sysync/binfileimplclient.cpp @@ -236,9 +236,7 @@ static TSyError writeTargetFeatureCheck( // macro simplifying typing in the table below -#define OFFS_SZ_TG(n) (offsetof(TBinfileDBSyncTarget,n)), sizeof(dP_tg->n) -// dummy pointer needed for sizeof -static const TBinfileDBSyncTarget *dP_tg=NULL; +#define OFFS_SZ_TG(n) (offsetof(TBinfileDBSyncTarget,n)), sizeof(((TBinfileDBSyncTarget *)NULL)->n) // accessor table for target key and for TARGETSETTING() script function const TStructFieldInfo TargetFieldInfos[] = @@ -679,9 +677,7 @@ static TSyError writeReadOnlyCheck( // macro simplifying typing in the table below -#define OFFS_SZ_PF(n) (offsetof(TBinfileDBSyncProfile,n)), sizeof(dP_pf->n) -// dummy pointer needed for sizeof -static const TBinfileDBSyncProfile *dP_pf=NULL; +#define OFFS_SZ_PF(n) (offsetof(TBinfileDBSyncProfile,n)), sizeof(((TBinfileDBSyncProfile *)NULL)->n) // accessor table for profiles and for PROFILESETTING script function const TStructFieldInfo ProfileFieldInfos[] = @@ -1058,9 +1054,7 @@ static TSyError readLogProfileName( // macro simplifying typing in the table below -#define OFFS_SZ_LOG(n) (offsetof(TLogFileEntry,n)), sizeof(dP_log->n) -// dummy pointer needed for sizeof -static const TLogFileEntry *dP_log=NULL; +#define OFFS_SZ_LOG(n) (offsetof(TLogFileEntry,n)), sizeof(((TLogFileEntry *)NULL)->n) // accessor table for log entries static const TStructFieldInfo LogEntryFieldInfos[] = -- cgit v1.2.3