Skip to content

Commit

Permalink
Prefer const assignment of char
Browse files Browse the repository at this point in the history
  • Loading branch information
thbeu committed Nov 28, 2024
1 parent 2657b18 commit 7ddecfa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dbfopen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,11 +1781,7 @@ int SHPAPI_CALL DBFMarkRecordDeleted(DBFHandle psDBF, int iShape,
/* -------------------------------------------------------------------- */
/* Assign value, marking record as dirty if it changes. */
/* -------------------------------------------------------------------- */
char chNewFlag;
if (bIsDeleted)
chNewFlag = '*';
else
chNewFlag = ' ';
const char chNewFlag = bIsDeleted ? '*' : ' ';

if (psDBF->pszCurrentRecord[0] != chNewFlag)
{
Expand Down Expand Up @@ -2296,7 +2292,7 @@ int SHPAPI_CALL DBFAlterFieldDefn(DBFHandle psDBF, int iField,

if (!errorAbort && psDBF->bWriteEndOfFileChar)
{
char ch = END_OF_FILE_CHARACTER;
const char ch = END_OF_FILE_CHARACTER;

SAOffset nRecordOffset =
psDBF->nRecordLength * STATIC_CAST(SAOffset, psDBF->nRecords) +
Expand Down

0 comments on commit 7ddecfa

Please sign in to comment.