Skip to content

Commit

Permalink
Consolidate deprecated linter stubs into single implementation file
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed Oct 13, 2024
1 parent e06b282 commit 52b9dbd
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 144 deletions.
5 changes: 1 addition & 4 deletions src/gs1syntaxdictionary-test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,19 @@
<ClCompile Include="lint_hasnondigit.c" />
<ClCompile Include="lint_hh.c" />
<ClCompile Include="lint_hhmi.c" />
<ClCompile Include="lint_hhmm.c" />
<ClCompile Include="lint_hyphen.c" />
<ClCompile Include="lint_iban.c" />
<ClCompile Include="lint_importeridx.c" />
<ClCompile Include="lint_iso3166.c" />
<ClCompile Include="lint_iso3166999.c" />
<ClCompile Include="lint_iso3166alpha2.c" />
<ClCompile Include="lint_iso3166list.c" />
<ClCompile Include="lint_iso4217.c" />
<ClCompile Include="lint_iso5218.c" />
<ClCompile Include="lint_key.c" />
<ClCompile Include="lint_latitude.c" />
<ClCompile Include="lint_longitude.c" />
<ClCompile Include="lint_mediatype.c" />
<ClCompile Include="lint_mi.c" />
<ClCompile Include="lint_mmoptss.c" />
<ClCompile Include="lint_nonzero.c" />
<ClCompile Include="lint_nozeroprefix.c" />
<ClCompile Include="lint_packagetype.c" />
Expand All @@ -160,10 +157,10 @@
<ClCompile Include="lint_yesno.c" />
<ClCompile Include="lint_yymmd0.c" />
<ClCompile Include="lint_yymmdd.c" />
<ClCompile Include="lint_yymmddhh.c" />
<ClCompile Include="lint_yyyymmd0.c" />
<ClCompile Include="lint_yyyymmdd.c" />
<ClCompile Include="lint_zero.c" />
<ClCompile Include="lint__stubs.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="acutest.h" />
Expand Down
15 changes: 3 additions & 12 deletions src/gs1syntaxdictionary-test.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
<ClCompile Include="lint_hhmi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_hhmm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_iban.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -75,9 +72,6 @@
<ClCompile Include="lint_iso3166alpha2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_iso3166list.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_iso4217.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -99,9 +93,6 @@
<ClCompile Include="lint_mi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_mmoptss.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_nonzero.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -132,9 +123,6 @@
<ClCompile Include="lint_yymmdd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_yymmddhh.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_yyyymmd0.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -147,6 +135,9 @@
<ClCompile Include="lint_zero.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint__stubs.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="acutest.h">
Expand Down
20 changes: 0 additions & 20 deletions src/gs1syntaxdictionary-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,4 @@ do { \
} \
} while (0)


/**
* @brief Generates a stub function to replace legacy linters.
*
* The generated stub function is retained for API compatibility purposes only
* and is no longer referenced by the Syntax Dictionary.
*
*/
#define GS1_LINTER_STUB(linter) \
GS1_SYNTAX_DICTIONARY_API DEPRECATED gs1_lint_err_t linter( \
const char* const data, \
size_t* const err_pos, \
size_t* const err_len) \
{ \
(void)data; \
(void)err_pos; \
(void)err_len; \
GS1_LINTER_RETURN_OK; \
}

#endif /* GS1_SYNTAXDICTIONARY_UTILS_H */
5 changes: 1 addition & 4 deletions src/gs1syntaxdictionary.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,19 @@
<ClCompile Include="lint_hasnondigit.c" />
<ClCompile Include="lint_hh.c" />
<ClCompile Include="lint_hhmi.c" />
<ClCompile Include="lint_hhmm.c" />
<ClCompile Include="lint_hyphen.c" />
<ClCompile Include="lint_iban.c" />
<ClCompile Include="lint_importeridx.c" />
<ClCompile Include="lint_iso3166.c" />
<ClCompile Include="lint_iso3166999.c" />
<ClCompile Include="lint_iso3166alpha2.c" />
<ClCompile Include="lint_iso3166list.c" />
<ClCompile Include="lint_iso4217.c" />
<ClCompile Include="lint_iso5218.c" />
<ClCompile Include="lint_key.c" />
<ClCompile Include="lint_latitude.c" />
<ClCompile Include="lint_longitude.c" />
<ClCompile Include="lint_mediatype.c" />
<ClCompile Include="lint_mi.c" />
<ClCompile Include="lint_mmoptss.c" />
<ClCompile Include="lint_nonzero.c" />
<ClCompile Include="lint_nozeroprefix.c" />
<ClCompile Include="lint_packagetype.c" />
Expand All @@ -160,8 +157,8 @@
<ClCompile Include="lint_yymmdd.c" />
<ClCompile Include="lint_yyyymmd0.c" />
<ClCompile Include="lint_yyyymmdd.c" />
<ClCompile Include="lint_yymmddhh.c" />
<ClCompile Include="lint_zero.c" />
<ClCompile Include="lint__stubs.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="gs1syntaxdictionary.h" />
Expand Down
15 changes: 3 additions & 12 deletions src/gs1syntaxdictionary.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
<ClCompile Include="lint_hhmi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_hhmm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_hyphen.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -72,9 +69,6 @@
<ClCompile Include="lint_iso3166alpha2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_iso3166list.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_iso4217.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -96,9 +90,6 @@
<ClCompile Include="lint_mi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_mmoptss.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_nonzero.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -126,9 +117,6 @@
<ClCompile Include="lint_yesno.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_yymmddhh.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint_yymmd0.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -144,6 +132,9 @@
<ClCompile Include="lint_zero.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lint__stubs.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="gs1syntaxdictionary.h">
Expand Down
33 changes: 31 additions & 2 deletions src/lint_iso3166list.c → src/lint__stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,43 @@
*/

/**
* @file lint_iso3166list.c
* @file lint__stubs.c
*
* @brief Not used.
* @brief Unused linter stub functions.
*
*/

#include <stddef.h>

#include "gs1syntaxdictionary.h"
#include "gs1syntaxdictionary-utils.h"


/**
* @brief Generates a stub function to replace legacy linters.
*
* The generated stub function is retained for API compatibility purposes only
* and is no longer referenced by the Syntax Dictionary.
*
*/
#define GS1_LINTER_STUB(linter) \
GS1_SYNTAX_DICTIONARY_API DEPRECATED gs1_lint_err_t linter( \
const char* const data, \
size_t* const err_pos, \
size_t* const err_len) \
{ \
(void)data; \
(void)err_pos; \
(void)err_len; \
GS1_LINTER_RETURN_OK; \
}


GS1_LINTER_STUB(gs1_lint_hhmm)
GS1_LINTER_STUB(gs1_lint_iso3166list)
GS1_LINTER_STUB(gs1_lint_mmoptss)
GS1_LINTER_STUB(gs1_lint_yymmddhh)


#undef GS1_LINTER_STUB

30 changes: 0 additions & 30 deletions src/lint_hhmm.c

This file was deleted.

30 changes: 0 additions & 30 deletions src/lint_mmoptss.c

This file was deleted.

30 changes: 0 additions & 30 deletions src/lint_yymmddhh.c

This file was deleted.

0 comments on commit 52b9dbd

Please sign in to comment.