From 343e8b38f6b122458ae52d87f0856eb01172d2b3 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sat, 18 May 2024 22:25:31 +0200 Subject: [PATCH 1/5] Fix spharm example for gcc14 --- src/samples/gu/spharm/cube.c | 5 +++-- src/samples/gu/spharm/spharm.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/samples/gu/spharm/cube.c b/src/samples/gu/spharm/cube.c index 4915fe35..1c3a5653 100644 --- a/src/samples/gu/spharm/cube.c +++ b/src/samples/gu/spharm/cube.c @@ -77,14 +77,14 @@ struct Vertex __attribute__((aligned(16))) vertices[12*3] = int done = 0; /* Exit callback */ -int exit_callback(void) +int exit_callback(int arg1, int arg2, void *common) { done = 1; return 0; } /* Callback thread */ -void CallbackThread(void *arg) +int CallbackThread(SceSize args, void *arg) { int cbid; @@ -92,6 +92,7 @@ void CallbackThread(void *arg) sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); + return cbid; } /* Sets up the callback thread and returns its thread id */ diff --git a/src/samples/gu/spharm/spharm.c b/src/samples/gu/spharm/spharm.c index 3651a8e8..2874b647 100644 --- a/src/samples/gu/spharm/spharm.c +++ b/src/samples/gu/spharm/spharm.c @@ -18,6 +18,7 @@ #include #include +#include #include "mt19937.h" /* @@ -31,7 +32,7 @@ float shift23=(float)(1<<23); float OOshift23=1.0f/(float)(1<<23); -static inline float floorf(float i) +inline float floorf(float i) { // return largest integer that is less than or equal to i float k = (float)((int) i); if (k <= i) From 549ed3a43f18e8f1498b36e5851005004e2f0a54 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sat, 18 May 2024 22:32:48 +0200 Subject: [PATCH 2/5] Fix mp3 sample for gcc 14 --- src/samples/mp3/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/samples/mp3/main.c b/src/samples/mp3/main.c index 5f0dd4d3..8e4c992a 100644 --- a/src/samples/mp3/main.c +++ b/src/samples/mp3/main.c @@ -60,8 +60,8 @@ int SetupCallbacks(void) // Input and Output buffers -char mp3Buf[16*1024] __attribute__((aligned(64))); -short pcmBuf[16*(1152/2)] __attribute__((aligned(64))); +unsigned char mp3Buf[16*1024] __attribute__((aligned(64))); +unsigned char pcmBuf[16*(1152/2)] __attribute__((aligned(64))); // Macro to allow formatted input without having to use stdargs.h @@ -87,9 +87,9 @@ void error( char* msg ) int fillStreamBuffer( int fd, int handle ) { - char* dst; - int write; - int pos; + unsigned char* dst; + long int write; + long int pos; // Get Info on the stream (where to fill to, how much to fill, where to fill from) int status = sceMp3GetInfoToAddStreamData( handle, &dst, &write, &pos); if (status<0) @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) printf("PSP Mp3 Sample v1.0 by Raphael\n\n"); printf("Playing '%s'...\n", MP3FILE); printf(" %i Hz\n", samplingRate); - printf(" %i kbit/s\n", sceMp3GetBitRate( handle )); + printf(" %li kbit/s\n", sceMp3GetBitRate( handle )); printf(" %s\n", numChannels==2?"Stereo":"Mono"); printf(" %s\n\n", loop==0?"No loop":"Loop"); int playTime = samplingRate>0?numPlayed / samplingRate:0; From 116094c366cb550604d7ac844e7b3feaf1cc6f9c Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sat, 18 May 2024 22:36:07 +0200 Subject: [PATCH 3/5] Resolve warning in nand dumpipl sample --- src/samples/nand/dumpipl/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samples/nand/dumpipl/main.c b/src/samples/nand/dumpipl/main.c index 37d4804d..757efea3 100644 --- a/src/samples/nand/dumpipl/main.c +++ b/src/samples/nand/dumpipl/main.c @@ -125,7 +125,7 @@ int ReadIPLBlockTable(void *pBlockBuf) die("can't read IPL block table!"); } - printf("Found IPL block table at block %d\n", uiBlockNum); + printf("Found IPL block table at block %ld\n", uiBlockNum); break; } From 2a9802e68d790bc98568bf32000a016e47111368 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sat, 18 May 2024 22:41:17 +0200 Subject: [PATCH 4/5] Fix net simple sample for gcc 14 --- src/samples/net/simple/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samples/net/simple/main.c b/src/samples/net/simple/main.c index fecc5303..d2475214 100644 --- a/src/samples/net/simple/main.c +++ b/src/samples/net/simple/main.c @@ -99,7 +99,7 @@ void start_server(const char *szIpAddr) int sock; int new = -1; struct sockaddr_in client; - size_t size; + long unsigned int size; int readbytes; char data[1024]; fd_set set; From 02bb3a4fa8960c53086453eb4dadd9e205fb8cd6 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Sat, 18 May 2024 22:43:15 +0200 Subject: [PATCH 5/5] Fix net simple_prx for gcc 14 --- src/samples/net/simple_prx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samples/net/simple_prx/main.c b/src/samples/net/simple_prx/main.c index f37ccd81..e042d4cb 100644 --- a/src/samples/net/simple_prx/main.c +++ b/src/samples/net/simple_prx/main.c @@ -65,7 +65,7 @@ void start_server(const char *szIpAddr) int sock; int new = -1; struct sockaddr_in client; - size_t size; + long unsigned int size; int readbytes; char data[1024]; fd_set set;