Skip to content

Commit

Permalink
c-API: simplify ZX_GETTER macro
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Mar 20, 2024
1 parent c5146f1 commit b8c4f71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/ZXingC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ uint8_t* ZXing_Barcode_bytesECI(const ZXing_Barcode* barcode, int* len)
}

#define ZX_GETTER(TYPE, GETTER, TRANS) \
TYPE ZXing_Barcode_##GETTER(const ZXing_Barcode* barcode) { return static_cast<TYPE>(TRANS(barcode->GETTER())); }
TYPE ZXing_Barcode_##GETTER(const ZXing_Barcode* barcode) { return TRANS(barcode->GETTER()); }

ZX_GETTER(ZXing_BarcodeFormat, format,)
ZX_GETTER(ZXing_ContentType, contentType,)
ZX_GETTER(ZXing_BarcodeFormat, format, static_cast<ZXing_BarcodeFormat>)
ZX_GETTER(ZXing_ContentType, contentType, static_cast<ZXing_ContentType>)
ZX_GETTER(char*, text, copy)
ZX_GETTER(char*, ecLevel, copy)
ZX_GETTER(char*, symbologyIdentifier, copy)
Expand Down

0 comments on commit b8c4f71

Please sign in to comment.