Skip to content

Conversation

hohle
Copy link
Contributor

@hohle hohle commented Aug 25, 2025

Make the FntPrint function signature consistent between header and impl and and put guard around duplicate CLAMP macro in libgpu/sys.c.

@hohle hohle force-pushed the build-warnings-2 branch from a1facb0 to fbac899 Compare August 25, 2025 22:04
@sozud
Copy link
Collaborator

sozud commented Aug 26, 2025

Needs build fixes

@hohle hohle force-pushed the build-warnings-2 branch 3 times, most recently from ebf7de1 to 66fa8d3 Compare August 27, 2025 03:14
hohle added 2 commits August 27, 2025 06:28
Make the `FntPrint` function signature consistent between header and
impl and and put guard around duplicate `CLAMP` macro in `libgpu/sys.c`.
@hohle hohle force-pushed the build-warnings-2 branch from 66fa8d3 to a6cead3 Compare August 27, 2025 13:43
@sozud
Copy link
Collaborator

sozud commented Aug 28, 2025

Could you post the warnings you're trying to avoid with these changes?

@hohle
Copy link
Contributor Author

hohle commented Aug 28, 2025

Both of these currently affect us. The CLAMP redeclaration also affects the portable build.

[551/1984] psx cc src/main/psxsdk/libgpu/font.c
src/main/psxsdk/libgpu/font.c:181: conflicting types for `FntPrint'
include/psxsdk/libgpu.h:603: previous declaration of `FntPrint'

and

[567/1984] psx cc src/main/psxsdk/libgpu/sys.c
src/main/psxsdk/libgpu/sys.c:68: warning: "CLAMP" redefined
   68 | #define CLAMP(value, low, high)                                                \
      | 
In file included from src/main/psxsdk/libgpu/sys.c:2:
include/common.h:146: note: this is the location of the previous definition
  146 | #define CLAMP(x, min, max) x < min ? min : (x > max ? max : x)
      | 

@sozud
Copy link
Collaborator

sozud commented Aug 30, 2025

The original signature of FntPrint is extern int FntPrint(...); in C++ mode or extern int FntPrint(); in C mode. I don't have an answer to this problem but figured I should point that out

https://github.com/sozud/psy-q/blob/2266d676f8de8a7e7a96d9cbb92854f0a55a86a1/3.5/PSX/INCLUDE/LIBGPU.H#L694

@hohle
Copy link
Contributor Author

hohle commented Sep 11, 2025

Unfortunately, the C++ signature, which is listed in the PDF docs isn't valid C, though it best represents the function. I'll try the empty arg version again and see if I can make progress there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants