Skip to content

Commit

Permalink
main,refactor: move field null string literals to header (#3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtikhonov committed May 31, 2023
1 parent 7731536 commit 100a7c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions main/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#include "optscript.h"
#include "script_p.h"

#define FIELD_NULL_LETTER_CHAR '-'
#define FIELD_NULL_LETTER_STRING "-"

typedef struct sFieldObject {
fieldDefinition *def;
vString *buffer;
Expand Down
3 changes: 3 additions & 0 deletions main/field_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* DATA DECLARATIONS
*/

#define FIELD_NULL_LETTER_CHAR '-'
#define FIELD_NULL_LETTER_STRING "-"


/*
* FUNCTION PROTOTYPES
Expand Down
3 changes: 1 addition & 2 deletions main/fmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ static int printTagField (fmtSpec* fspec, MIO* fp, const tagEntryInfo * tag)
str = renderField (f->ftype, tag, findex);
if ((dt & FIELDTYPE_BOOL) && str[0] == '\0')
{
/* TODO: FIELD_NULL_LETTER_STRING */
str = "-";
str = FIELD_NULL_LETTER_STRING;
}
}
else if (dt & FIELDTYPE_BOOL)
Expand Down

0 comments on commit 100a7c2

Please sign in to comment.