Normalize code style to match established conventions
An assistant-written stretch of code had drifted from the conventions the older hand-written files establish. Sweeps the whole of src/ back into line. Systematic: - @returns -> @return (163 occurrences, 84 files). Concentrated in ui/ and rpg/cutscene/; the rest of the tree already used @return 646 times. - Lowercase "null" -> "NULL" in assert/error message strings (170 occurrences, 28 files), matching the dominant 441-use spelling. Covers "cannot be null", "must not be null" and adjectival uses. Localized: - sort.c: drop a stray #include <stdlib.h> that sat *above* the copyright header, leaving it the only file in the repo without a leading header block. Also drops the same redundant include from random.c and npcturn.c (dusk.h already pulls in stdlib.h). - Convert 7 files' license headers from // lines to the /** */ block form. - cutscenesystem.c: memset -> memoryZero, matching the identical call ~20 lines further down and the rest of the codebase. - Struct tags suffixed _t -> _s: threadlock_t -> threadmutex_s (which also makes the tag match its typedef) and chunkpos_t -> chunkpos_s. - Convert 20 inline /* */ block comments to // across the mesh builders, assetfile.c and assetlocaleloader.c. - Pointer truthiness if(!ptr) -> if(ptr == NULL) in 16 places, matching the 267 existing explicit comparisons. Boolean !x checks are left alone. - entityanim.h: drop a JSDoc-style type annotation from an @return. - Document easing.h's 16 undeclared easing functions and assetjsonloader.h's 3 loader callbacks. No behavioral change. Builds clean with no new warnings; ctest shows the same 6 pre-existing failures as HEAD, verified against a pristine worktree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#define SAVE_DEVICE_PSP_PATH_MAX 64
|
||||
|
||||
errorret_t saveDevicePSPInit(savedevice_t *device) {
|
||||
assertNotNull(device, "device cannot be null");
|
||||
assertNotNull(device, "device cannot be NULL");
|
||||
|
||||
device->state = SAVE_DEVICE_STATE_UNKNOWN;
|
||||
|
||||
@@ -24,13 +24,13 @@ errorret_t saveDevicePSPInit(savedevice_t *device) {
|
||||
}
|
||||
|
||||
errorret_t saveDevicePSPUpdate(savedevice_t *device) {
|
||||
assertNotNull(device, "device cannot be null");
|
||||
assertNotNull(device, "device cannot be NULL");
|
||||
assertIsMainThread("Invalid thread");
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void saveDevicePSPCheckAvailability(savedevice_t *device) {
|
||||
assertNotNull(device, "device cannot be null");
|
||||
assertNotNull(device, "device cannot be NULL");
|
||||
assertIsMainThread("Invalid thread");
|
||||
assertTrue(
|
||||
device->state == SAVE_DEVICE_STATE_CHECKING_AVAILABILITY,
|
||||
@@ -61,7 +61,7 @@ errorret_t saveDevicePSPGetDataPath(
|
||||
char_t *dest,
|
||||
const size_t destSize
|
||||
) {
|
||||
assertNotNull(dest, "dest cannot be null");
|
||||
assertNotNull(dest, "dest cannot be NULL");
|
||||
|
||||
stringFormat(
|
||||
dest, destSize, "%s/%s",
|
||||
@@ -76,8 +76,8 @@ errorret_t saveDevicePSPDataWrite(
|
||||
const uint8_t *buffer,
|
||||
size_t size
|
||||
) {
|
||||
assertNotNull(device, "device cannot be null");
|
||||
assertNotNull(buffer, "buffer cannot be null");
|
||||
assertNotNull(device, "device cannot be NULL");
|
||||
assertNotNull(buffer, "buffer cannot be NULL");
|
||||
|
||||
char_t finalPath[SAVE_DEVICE_PSP_PATH_MAX];
|
||||
errorChain(saveDevicePSPGetDataPath(finalPath, sizeof(finalPath)));
|
||||
@@ -112,9 +112,9 @@ errorret_t saveDevicePSPDataRead(
|
||||
uint8_t **outBuffer,
|
||||
size_t *outSize
|
||||
) {
|
||||
assertNotNull(device, "device cannot be null");
|
||||
assertNotNull(outBuffer, "outBuffer cannot be null");
|
||||
assertNotNull(outSize, "outSize cannot be null");
|
||||
assertNotNull(device, "device cannot be NULL");
|
||||
assertNotNull(outBuffer, "outBuffer cannot be NULL");
|
||||
assertNotNull(outSize, "outSize cannot be NULL");
|
||||
|
||||
char_t path[SAVE_DEVICE_PSP_PATH_MAX];
|
||||
errorChain(saveDevicePSPGetDataPath(path, sizeof(path)));
|
||||
|
||||
Reference in New Issue
Block a user