Skip to content

Commit

Permalink
main: make the second argument for makePtagIfEnabled read only
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed Sep 25, 2019
1 parent ac34646 commit 0f80f0d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions main/ptag.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <string.h>


static bool ptagMakeFormat (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeFormat (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
char format [11];
const char *formatComment = "unknown format";
Expand All @@ -38,7 +38,7 @@ static bool ptagMakeFormat (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
return writePseudoTag (desc, format, formatComment, NULL);
}

static bool ptagMakeHowSorted (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeHowSorted (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
return writePseudoTag (desc,
Option.sorted == SO_FOLDSORTED ? "2" :
Expand All @@ -47,32 +47,32 @@ static bool ptagMakeHowSorted (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
NULL);
}

static bool ptagMakeAuthor (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeAuthor (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
return writePseudoTag (desc,
AUTHOR_NAME, "", NULL);
}

static bool ptagMakeProgName (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeProgName (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
return writePseudoTag (desc,
PROGRAM_NAME, "Derived from Exuberant Ctags", NULL);
}

static bool ptagMakeProgURL (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeProgURL (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
return writePseudoTag (desc,
PROGRAM_URL, "official site", NULL);
}

static bool ptagMakeProgVersion (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeProgVersion (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
const char* repoinfo = ctags_repoinfo? ctags_repoinfo: "";
return writePseudoTag (desc, PROGRAM_VERSION, repoinfo, NULL);
}

#ifdef HAVE_ICONV
static bool ptagMakeFileEncoding (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
static bool ptagMakeFileEncoding (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
if (! Option.outputEncoding)
return false;
Expand All @@ -81,16 +81,16 @@ static bool ptagMakeFileEncoding (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
}
#endif

static bool ptagMakeKindSeparators (ptagDesc *desc, void *data)
static bool ptagMakeKindSeparators (ptagDesc *desc, const void *data)
{
langType *language = data;
const langType *language = data;

return makeKindSeparatorsPseudoTags (*language, desc);
}

static bool ptagMakeKindDescriptions (ptagDesc *desc, void *data)
static bool ptagMakeKindDescriptions (ptagDesc *desc, const void *data)
{
langType *language = data;
const langType *language = data;
return makeKindDescriptionsPseudoTags (*language, desc);
}

Expand Down Expand Up @@ -146,7 +146,7 @@ static ptagDesc ptagDescs [] = {
true },
};

extern bool makePtagIfEnabled (ptagType type, void *data)
extern bool makePtagIfEnabled (ptagType type, const void *data)
{
ptagDesc *desc;

Expand Down
4 changes: 2 additions & 2 deletions main/ptag_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ struct sPtagDesc {
bool enabled;
const char* name;
const char* description; /* displayed in --list-pseudo-tags output */
bool (* makeTag) (ptagDesc *, void *);
bool (* makeTag) (ptagDesc *, const void *);
bool commonInParsers;
};

extern bool makePtagIfEnabled (ptagType type, void *data);
extern bool makePtagIfEnabled (ptagType type, const void *data);
extern ptagDesc* getPtagDesc (ptagType type);
extern ptagType getPtagTypeForName (const char *name);
extern void printPtags (bool withListHeader, bool machinable, FILE *fp);
Expand Down
2 changes: 1 addition & 1 deletion main/writer-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static int writeJsonPtagEntry (tagWriter *writer CTAGS_ATTR_UNUSED,
#undef OPT
}

extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
return writePseudoTag (desc,
"0.0",
Expand Down
2 changes: 1 addition & 1 deletion main/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extern void writerRescanFailed (unsigned long validTagNum)
writer->rescanFailedEntry(writer, validTagNum, writer->clientData);
}

extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED)
{
const char *mode ="";

Expand Down
4 changes: 2 additions & 2 deletions main/writer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ extern void truncateTagLineAfterTag (char *const line, const char *const token,
const bool discardNewline);
extern void abort_if_ferror(MIO *const fp);

extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED);
extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED);
extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED);
extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, const void *data CTAGS_ATTR_UNUSED);

extern bool writerCanPrintPtag (void);
extern bool writerDoesTreatFieldAsFixed (int fieldType);
Expand Down

0 comments on commit 0f80f0d

Please sign in to comment.