diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-02 13:02:19 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-02 13:15:27 +0200 |
commit | 7a93c19ebe580e2d1286112bb5ba05e969320ad2 (patch) | |
tree | 9bddbbdbade4c530c0c5c6baa9d0ffba02b1f486 | |
parent | 2754abfe49755045b9f769f406366be4ec708d59 (diff) |
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.
-rwxr-xr-x | src/sysync/binfileimplclient.cpp | 12 |
1 files 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[] = |