diff --git a/contrib/csv2shp.c b/contrib/csv2shp.c index 8d3ba9e..4027d7d 100644 --- a/contrib/csv2shp.c +++ b/contrib/csv2shp.c @@ -246,7 +246,7 @@ void strip_crlf(char *line) } } -static void IGNORE_FGETS_RET_VAL(char* s) +static void IGNORE_FGETS_RET_VAL(char *s) { (void)s; } diff --git a/contrib/shpsort.c b/contrib/shpsort.c index 5d94311..fd8116d 100644 --- a/contrib/shpsort.c +++ b/contrib/shpsort.c @@ -144,8 +144,8 @@ static void copy_related(const char *inName, const char *outName, size_t name_len = strlen(inName); const size_t old_len = strlen(old_ext); const size_t new_len = strlen(new_ext); - - if( name_len < old_len ) + + if (name_len < old_len) return; char *in = malloc(name_len - old_len + new_len + 1); diff --git a/dbfopen.c b/dbfopen.c index c90defc..5f356d0 100644 --- a/dbfopen.c +++ b/dbfopen.c @@ -42,9 +42,6 @@ #define snprintf _snprintf #endif #endif - -#define CPLsprintf sprintf -#define CPLsnprintf snprintf #endif #ifndef FALSE @@ -1322,8 +1319,8 @@ static bool DBFWriteAttribute(DBFHandle psDBF, int hEntity, int iField, char szFormat[20]; snprintf(szFormat, sizeof(szFormat), "%%%d.%df", nWidth, psDBF->panFieldDecimals[iField]); - CPLsnprintf(szSField, sizeof(szSField), szFormat, - *STATIC_CAST(double *, pValue)); + snprintf(szSField, sizeof(szSField), szFormat, + *STATIC_CAST(double *, pValue)); szSField[sizeof(szSField) - 1] = '\0'; if (STATIC_CAST(int, strlen(szSField)) > psDBF->panFieldSize[iField]) @@ -2053,7 +2050,7 @@ int SHPAPI_CALL DBFAlterFieldDefn(DBFHandle psDBF, int iField, /* -------------------------------------------------------------------- */ /* Update the header information. */ /* -------------------------------------------------------------------- */ - char *pszFInfo = psDBF->pszHeader + XBASE_FLDHDR_SZ * iField; + unsigned char *pszFInfo = psDBF->pszHeader + XBASE_FLDHDR_SZ * iField; for (int i = 0; i < XBASE_FLDHDR_SZ; i++) pszFInfo[i] = '\0'; @@ -2247,7 +2244,7 @@ int SHPAPI_CALL DBFAlterFieldDefn(DBFHandle psDBF, int iField, SAOffset nRecordOffset = psDBF->nRecordLength * STATIC_CAST(SAOffset, psDBF->nRecords) + - psDBF->nHeaderLength; + STATIC_CAST(SAOffset, psDBF->nHeaderLength); psDBF->sHooks.FSeek(psDBF->fp, nRecordOffset, 0); psDBF->sHooks.FWrite(&ch, 1, 1, psDBF->fp); diff --git a/shapefil.h b/shapefil.h index e499818..4844b7f 100644 --- a/shapefil.h +++ b/shapefil.h @@ -27,22 +27,25 @@ extern "C" { #endif -/************************************************************************/ -/* Version related macros (added in 1.6.0) */ -/************************************************************************/ + /************************************************************************/ + /* Version related macros (added in 1.6.0) */ + /************************************************************************/ #define SHAPELIB_VERSION_MAJOR 1 #define SHAPELIB_VERSION_MINOR 6 #define SHAPELIB_VERSION_MICRO 0 -#define SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro) \ - ((major) * 10000 + (minor) * 100 + (micro)) +#define SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro) \ + ((major)*10000 + (minor)*100 + (micro)) -#define SHAPELIB_VERSION_NUMBER \ - SHAPELIB_MAKE_VERSION_NUMBER(SHAPELIB_VERSION_MAJOR, SHAPELIB_VERSION_MINOR, SHAPELIB_VERSION_MICRO) +#define SHAPELIB_VERSION_NUMBER \ + SHAPELIB_MAKE_VERSION_NUMBER(SHAPELIB_VERSION_MAJOR, \ + SHAPELIB_VERSION_MINOR, \ + SHAPELIB_VERSION_MICRO) -#define SHAPELIB_AT_LEAST(major, minor, micro) \ - (SHAPELIB_VERSION_NUMBER >= SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro)) +#define SHAPELIB_AT_LEAST(major, minor, micro) \ + (SHAPELIB_VERSION_NUMBER >= \ + SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro)) /************************************************************************/ /* Configuration options. */