Skip to content

Commit

Permalink
Fixing warnings that are errors in newer versions of clang
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Jun 5, 2024
1 parent aeba90c commit 815c02f
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 49 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pharo-vm/
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

#vscode
.vscode/

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -367,4 +370,4 @@ healthchecksdb
/stack32/generated
/stack64/generated

**/.DS_Store
**/.DS_Store
8 changes: 4 additions & 4 deletions extracted/plugins/B2DPlugin/src/common/B2DPlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,15 @@ static sqInt (*makePointwithxValueyValue)(sqInt xValue, sqInt yValue);
static sqInt (*methodArgumentCount)(void);
static sqInt (*nilObject)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*popRemappableOop)(void);
static sqInt (*positive32BitIntegerFor)(unsigned int integerValue);
static usqInt (*positive32BitValueOf)(sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*pushBool)(sqInt trueOrFalse);
static sqInt (*pushInteger)(sqInt integerValue);
static sqInt (*pushRemappableOop)(sqInt oop);
static void (*pushRemappableOop)(sqInt oop);
static sqInt (*slotSizeOf)(sqInt oop);
static sqInt (*stackIntegerValue)(sqInt offset);
static sqInt (*stackObjectValue)(sqInt offset);
Expand Down Expand Up @@ -813,15 +813,15 @@ extern sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
extern sqInt methodArgumentCount(void);
extern sqInt nilObject(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt popRemappableOop(void);
extern sqInt positive32BitIntegerFor(unsigned int integerValue);
extern usqInt positive32BitValueOf(sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt pushBool(sqInt trueOrFalse);
extern sqInt pushInteger(sqInt integerValue);
extern sqInt pushRemappableOop(sqInt oop);
extern void pushRemappableOop(sqInt oop);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt stackIntegerValue(sqInt offset);
extern sqInt stackObjectValue(sqInt offset);
Expand Down
4 changes: 2 additions & 2 deletions extracted/plugins/BitBltPlugin/src/common/BitBltPlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static sqInt (*methodReturnInteger)(sqInt integer);
static sqInt (*methodReturnReceiver)(void);
static sqInt (*nilObject)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*positive32BitIntegerFor)(unsigned int integerValue);
static usqInt (*positive32BitValueOf)(sqInt oop);
static usqLong (*positive64BitValueOf)(sqInt oop);
Expand Down Expand Up @@ -329,7 +329,7 @@ extern sqInt methodReturnInteger(sqInt integer);
extern sqInt methodReturnReceiver(void);
extern sqInt nilObject(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt positive32BitIntegerFor(unsigned int integerValue);
extern usqInt positive32BitValueOf(sqInt oop);
extern usqLong positive64BitValueOf(sqInt oop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ static sqInt (*isKindOf)(sqInt oop, char *aString);
static sqInt (*isBytes)(sqInt oop);
static sqInt (*methodReturnValue)(sqInt oop);
static sqInt (*nilObject)(void);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*popRemappableOop)(void);
static sqInt (*positive32BitIntegerFor)(unsigned int integerValue);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*primitiveFailForOSError)(sqLong osError);
static sqInt (*primitiveFailureCode)(void);
static sqInt (*pushRemappableOop)(sqInt oop);
static void (*pushRemappableOop)(sqInt oop);
static sqInt (*stSizeOf)(sqInt oop);
static sqInt (*stackIntegerValue)(sqInt offset);
static sqInt (*stackObjectValue)(sqInt offset);
Expand All @@ -147,7 +147,7 @@ extern sqInt isKindOf(sqInt oop, char *aString);
extern sqInt isBytes(sqInt oop);
extern sqInt methodReturnValue(sqInt oop);
extern sqInt nilObject(void);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt popRemappableOop(void);
extern sqInt positive32BitIntegerFor(unsigned int integerValue);
extern sqInt primitiveFail(void);
Expand All @@ -158,7 +158,7 @@ extern sqInt primitiveFailForOSError(sqLong osError);
# define primitiveFailForOSError(osError) 0
#endif
extern sqInt primitiveFailureCode(void);
extern sqInt pushRemappableOop(sqInt oop);
extern void pushRemappableOop(sqInt oop);
extern sqInt stSizeOf(sqInt oop);
extern sqInt stackIntegerValue(sqInt offset);
extern sqInt stackObjectValue(sqInt offset);
Expand Down Expand Up @@ -712,7 +712,8 @@ primitiveLogicalDrives(void)
# if defined(_WIN32)
mask = GetLogicalDrives();
if (mask != 0) {
return popthenPush(1, positive32BitIntegerFor(mask));
popthenPush(1, positive32BitIntegerFor(mask));
return 0;
}
# endif /* defined(_WIN32) */
primitiveFail();
Expand Down Expand Up @@ -813,7 +814,8 @@ primitiveOpendir(void)
EXPORT(sqInt)
primitivePathMax(void)
{
return popthenPush(1, integerObjectOf(FA_PATH_MAX));
popthenPush(1, integerObjectOf(FA_PATH_MAX));
return 0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static sqInt (*isBytes)(sqInt oop);
static sqInt (*isIntegerObject)(sqInt objectPointer);
static sqInt (*isWordsOrBytes)(sqInt oop);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*stSizeOf)(sqInt oop);
Expand Down Expand Up @@ -101,7 +101,7 @@ extern sqInt isIntegerObject(sqInt objectPointer);
#endif
extern sqInt isWordsOrBytes(sqInt oop);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt stSizeOf(sqInt oop);
Expand Down
8 changes: 4 additions & 4 deletions extracted/plugins/LargeIntegers/src/common/LargeIntegers.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ static sqInt (*integerObjectOf)(sqInt value);
static sqInt (*integerValueOf)(sqInt oop);
static sqInt (*isBooleanObject)(sqInt oop);
static sqInt (*isIntegerObject)(sqInt objectPointer);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*popRemappableOop)(void);
static usqInt (*positive32BitValueOf)(sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*pushRemappableOop)(sqInt oop);
static void (*pushRemappableOop)(sqInt oop);
static sqInt (*slotSizeOf)(sqInt oop);
static sqInt (*stObjectatput)(sqInt array, sqInt index, sqInt value);
static sqInt (*stackIntegerValue)(sqInt offset);
Expand Down Expand Up @@ -150,12 +150,12 @@ extern sqInt isBooleanObject(sqInt oop);
#if !defined(isIntegerObject)
extern sqInt isIntegerObject(sqInt objectPointer);
#endif
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt popRemappableOop(void);
extern usqInt positive32BitValueOf(sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt pushRemappableOop(sqInt oop);
extern void pushRemappableOop(sqInt oop);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
extern sqInt stackIntegerValue(sqInt offset);
Expand Down
4 changes: 2 additions & 2 deletions extracted/plugins/LocalePlugin/src/common/LocalePlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static sqInt (*falseObject)(void);
static void * (*firstIndexableField)(sqInt oop);
static sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size);
static sqInt (*integerObjectOf)(sqInt value);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*trueObject)(void);
#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
extern sqInt classString(void);
Expand All @@ -72,7 +72,7 @@ extern sqInt falseObject(void);
extern void * firstIndexableField(sqInt oop);
extern sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size);
extern sqInt integerObjectOf(sqInt value);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt trueObject(void);
extern
#endif
Expand Down
8 changes: 4 additions & 4 deletions extracted/plugins/SocketPlugin/src/common/SocketPlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ static sqInt (*isWords)(sqInt oop);
static sqInt (*isWordsOrBytes)(sqInt oop);
static sqInt (*methodArgumentCount)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*popRemappableOop)(void);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*pushRemappableOop)(sqInt oop);
static void (*pushRemappableOop)(sqInt oop);
static sqInt (*slotSizeOf)(sqInt oop);
static sqInt (*stackIntegerValue)(sqInt offset);
static sqInt (*stackValue)(sqInt offset);
Expand All @@ -160,11 +160,11 @@ extern sqInt isWords(sqInt oop);
extern sqInt isWordsOrBytes(sqInt oop);
extern sqInt methodArgumentCount(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt popRemappableOop(void);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt pushRemappableOop(sqInt oop);
extern void pushRemappableOop(sqInt oop);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt stackIntegerValue(sqInt offset);
extern sqInt stackValue(sqInt offset);
Expand Down
4 changes: 2 additions & 2 deletions extracted/plugins/SqueakSSL/src/common/SqueakSSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static sqInt (*isBytes)(sqInt oop);
static sqInt (*methodArgumentCount)(void);
static sqInt (*nilObject)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*pushInteger)(sqInt integerValue);
static sqInt (*signed32BitIntegerFor)(sqInt integerValue);
Expand All @@ -78,7 +78,7 @@ extern sqInt isBytes(sqInt oop);
extern sqInt methodArgumentCount(void);
extern sqInt nilObject(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt pushInteger(sqInt integerValue);
extern sqInt signed32BitIntegerFor(sqInt integerValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ static sqInt (*methodArgumentCount)(void);
static sqInt (*methodReturnValue)(sqInt oop);
static sqInt (*nilObject)(void);
static sqInt (*pop)(sqInt nItems);
static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
static void (*popthenPush)(sqInt nItems, sqInt oop);
static sqInt (*popRemappableOop)(void);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static (*push)(sqInt object);
static void (*push)(sqInt object);
static sqInt (*pushInteger)(sqInt integerValue);
static sqInt (*pushRemappableOop)(sqInt oop);
static void (*pushRemappableOop)(sqInt oop);
static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
static sqInt (*sizeOfSTArrayFromCPrimitive)(void *cPtr);
static sqInt (*stObjectatput)(sqInt array, sqInt index, sqInt value);
Expand Down Expand Up @@ -315,13 +315,13 @@ extern sqInt methodArgumentCount(void);
extern sqInt methodReturnValue(sqInt oop);
extern sqInt nilObject(void);
extern sqInt pop(sqInt nItems);
extern sqInt popthenPush(sqInt nItems, sqInt oop);
extern void popthenPush(sqInt nItems, sqInt oop);
extern sqInt popRemappableOop(void);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt push(sqInt object);
extern void push(sqInt object);
extern sqInt pushInteger(sqInt integerValue);
extern sqInt pushRemappableOop(sqInt oop);
extern void pushRemappableOop(sqInt oop);
extern sqInt signalSemaphoreWithIndex(sqInt semaIndex);
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
Expand Down Expand Up @@ -1187,7 +1187,9 @@ getStdHandle(sqInt n)
return primitiveFailFor(PrimErrNoMemory);
}
memcpy(firstIndexableField(fileOop), &fileRecords[n], sizeof(SQFile));
return popthenPush(1, fileOop);
popthenPush(1, fileOop);

return fileOop;
}

/* OSProcessPlugin>>#getThisSessionIdentifier */
Expand Down Expand Up @@ -4287,7 +4289,6 @@ reapChildProcess(int sigNum)
}
}


/* Signal sigNum has been caught by a thread other than the pthread in which
the interpreter is executing. Rather than handling it in this thread,
resend it to the interpreter thread. */
Expand Down Expand Up @@ -4431,6 +4432,14 @@ setInterpreter(struct VirtualMachine *anInterpreter)
return ok;
}

# if defined(SA_NOCLDSTOP)
/* This wrapper is used to handle the new signature of the function */

static void
reapChildProcessWrapper(int sigNum, struct __siginfo * sigInfo, void * userData){
reapChildProcess(sigNum);
}
# endif

/* Set the SIGCHLD signal handler in the virtual machine. */

Expand All @@ -4442,7 +4451,7 @@ setSigChldHandler(void)


# if defined(SA_NOCLDSTOP)
sigchldHandlerAction.sa_sigaction = reapChildProcess;
sigchldHandlerAction.sa_sigaction = reapChildProcessWrapper;
sigchldHandlerAction.sa_flags = SA_NODEFER | SA_NOCLDSTOP;
if (needSigaltstack()) {
sigchldHandlerAction.sa_flags |= SA_ONSTACK;
Expand Down
16 changes: 8 additions & 8 deletions extracted/vm/include/common/sqVirtualMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

#include "sqMemoryAccess.h"

#include "pharovm/semaphores/pSemaphore.h"

#if VM_PROXY_MINOR > 8
# define PrimNoErr 0
# define PrimErrGenericFailure 1
Expand All @@ -47,8 +49,6 @@
# define PrimErrNamedInternal 13
# define PrimErrObjectMayMove 14

/* VMCallbackContext opaque type avoids all including setjmp.h & vmCallback.h */
typedef struct _VMCallbackContext *vmccp;
#endif

typedef sqInt (*CompilerHook)();
Expand All @@ -62,7 +62,7 @@ typedef struct VirtualMachine {
/* InterpreterProxy methodsFor: 'stack access' */

sqInt (*pop)(sqInt nItems);
sqInt (*popthenPush)(sqInt nItems, sqInt oop);
void (*popthenPush)(sqInt nItems, sqInt oop);
void (*push)(sqInt object);
sqInt (*pushBool)(sqInt trueOrFalse);
void (*pushFloat)(double f);
Expand Down Expand Up @@ -155,7 +155,7 @@ typedef struct VirtualMachine {
sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size);
sqInt (*makePointwithxValueyValue)(sqInt xValue, sqInt yValue);
sqInt (*popRemappableOop)(void);
sqInt (*pushRemappableOop)(sqInt oop);
void (*pushRemappableOop)(sqInt oop);

/* InterpreterProxy methodsFor: 'other' */

Expand Down Expand Up @@ -312,7 +312,7 @@ typedef struct VirtualMachine {

#if VM_PROXY_MINOR > 12 /* Spur */
sqInt (*isImmediate)(sqInt objOop);
sqInt (*characterObjectOf)(int charCode);
sqInt (*characterObjectOf)(sqInt charCode);
sqInt (*characterValueOf)(sqInt objOop);
sqInt (*isCharacterObject)(sqInt objOop);
sqInt (*isCharacterValue)(int charCode);
Expand All @@ -331,11 +331,11 @@ typedef struct VirtualMachine {
sqInt (*isPositiveMachineIntegerObject)(sqInt);
#endif

sqInt (*ptEnterInterpreterFromCallback)(vmccp);
sqInt (*ptExitInterpreterToCallback)(vmccp);
sqInt (*ptEnterInterpreterFromCallback)(void *);
sqInt (*ptExitInterpreterToCallback)(void *);
sqInt (*isNonImmediate)(sqInt oop);

sqInt (*platformSemaphoreNew)(int initialValue);
Semaphore* (*platformSemaphoreNew)(int initialValue);

sqInt (*scheduleInMainThread)(sqInt (*closure)());

Expand Down
3 changes: 2 additions & 1 deletion extracted/vm/src/common/sqExternalSemaphores.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ doSignalExternalSemaphores(sqInt externalSemaphoreTableSize)
}
sqLowLevelMFence();

requestMutex->signal(requestMutex);

/* doing this here saves a bounds check in doSignalSemaphoreWithIndex */
if (highTide >= externalSemaphoreTableSize)
highTide = externalSemaphoreTableSize - 1;
Expand All @@ -251,7 +253,6 @@ doSignalExternalSemaphores(sqInt externalSemaphoreTableSize)
signalled = 1;
}

requestMutex->signal(requestMutex);
#if !defined(_WIN32)
sigprocmask(SIG_UNBLOCK, &blockedSignalSet, NULL);
#endif
Expand Down
Loading

0 comments on commit 815c02f

Please sign in to comment.