Skip to content

Commit

Permalink
Merge pull request #203 from pspdev/fix-gcc14
Browse files Browse the repository at this point in the history
Fix samples for gcc14
diamant3 authored May 18, 2024
2 parents b6d0f42 + 02bb3a4 commit 91c849e
Showing 6 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/samples/gu/spharm/cube.c
Original file line number Diff line number Diff line change
@@ -77,21 +77,22 @@ 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;

cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);

sceKernelSleepThreadCB();
return cbid;
}

/* Sets up the callback thread and returns its thread id */
3 changes: 2 additions & 1 deletion src/samples/gu/spharm/spharm.c
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
#include <pspgu.h>
#include <pspgum.h>

#include <math.h>
#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)
12 changes: 6 additions & 6 deletions src/samples/mp3/main.c
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/samples/nand/dumpipl/main.c
Original file line number Diff line number Diff line change
@@ -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;
}

2 changes: 1 addition & 1 deletion src/samples/net/simple/main.c
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/samples/net/simple_prx/main.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 91c849e

Please sign in to comment.