huawei-ups2000.c: rename NULL macros, close #1474. #1515
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally, in the struct array
ups2000_cmd[]
, aREG_NONE
macro was used as a short-hand for a nonexistent register value. Unfortunately it was in conflict with a Windows NT macro of the same name (previously not found because it was only tested on Unix systems). Thus, this commit renames it toREG_NULL
. To avoid visual confusions with the function pointer field (which also uses C's NULL for its nonexistence), this commit also replaces it with a new macroFUNC_NULL
, which is a simple alias to C'sNULL
.It's not exactly the best practice, a
UPS2000_
prefix should've been used in principle. However, using it in this case creates exceedingly long lines and makes the struct array definition more difficult to read, which defeats the very purpose of defining these macros to begin with. Considering that it's only an one-off use, it's unlikely to cause further problems.This PR closes #1474.