ripose-jp / Memento

An mpv-based video player for studying Japanese
https://ripose-jp.github.io/Memento/
GNU General Public License v2.0
490 stars 21 forks source link

yomidbbuilder: support null values for the def tags #166

Closed precondition closed 1 year ago

precondition commented 1 year ago

A term bank containing a term with its def tags set to null would cause an error because only strings were allowed even though the yomichan dictionary term bank schema allows not only strings but also nulls (treated the same as empty strings "").

This PR solves issue #165.

I opted to directly include DEF_TAGS_INDEX in the arguments of fprintf(stderr, ...) without casting it to size_t.

ripose-jp commented 1 year ago

Excellent work. I'll merge this as soon as CI passes.

precondition commented 1 year ago

/Users/runner/work/Memento/Memento/src/dict/yomidbbuilder.c:1895:33: error: 'zip_get_num_files' is deprecated: use 'zip_get_num_entries' instead [-Werror,-Wdeprecated-declarations] for (zip_int64_t i = 0; i < zip_get_num_files(dict_archive); ++i) ^ /usr/local/include/zip.h:379:1: note: 'zip_get_num_files' has been explicitly marked deprecated here ZIP_DEPRECATED("use 'zip_get_num_entries' instead") ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); ^ [ 25%] Building CXX object src/util/CMakeFiles/utils.dir/utils.cpp.o /usr/local/include/zip.h:63:42: note: expanded from macro 'ZIP_DEPRECATED' [ 25%] Building CXX object src/util/CMakeFiles/utils.dir/utils_autogen/mocs_compilation.cpp.o

define ZIP_DEPRECATED(x) attribute((deprecated(x)))

^

Welp, that's out of scope for this pull request

ripose-jp commented 1 year ago

libzip rugpulled and started adding Apple Clang extensions to header files in a recent version. CMake disables extensions by default, so the build has started to fail on macOS. I'll merge this without that passing because I see that it works on Linux just fine and I don't want you to have to rebase on master just so I can run a CI pipeline I know will pass.