mirror of
https://github.com/jeremysrand/BuGS.git
synced 2024-06-14 04:29:28 +00:00
Cleanup parse errors which appear in the latest Xcode.
This commit is contained in:
parent
0ae5fa1b54
commit
1be8d217f1
|
@ -6,15 +6,16 @@
|
|||
* Copyright © 2021 Jeremy Rand. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <Hash.h>
|
||||
#include <locator.h>
|
||||
#include <misctool.h>
|
||||
#include <stdint.h>
|
||||
#include <orca.h>
|
||||
#include <tcpip.h>
|
||||
#include <types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "globalScores.h"
|
||||
|
||||
|
@ -181,6 +182,10 @@ static void handleClosingTcp(void);
|
|||
|
||||
// Globals
|
||||
|
||||
#if __ORCAC__
|
||||
segment "highscores";
|
||||
#endif
|
||||
|
||||
static tGameNetworkStateHandler handlers[NUM_GAME_NETWORK_STATES] = {
|
||||
handleConnectFailed,
|
||||
handleUnconnected,
|
||||
|
@ -222,9 +227,6 @@ tSetHighScoreRequestWithHash setHighScoreRequest;
|
|||
|
||||
// Implementation
|
||||
|
||||
|
||||
segment "highscores";
|
||||
|
||||
void initNetwork(tHighScoreInitParams * params)
|
||||
{
|
||||
networkGlobals = NULL;
|
||||
|
@ -411,7 +413,7 @@ static void handleUnconnected(void)
|
|||
|
||||
static void handleConnected(void)
|
||||
{
|
||||
TCPIPDNRNameToIP(networkGlobals->initParams.scoreServer, &(networkGlobals->domainNameResolution));
|
||||
TCPIPDNRNameToIP((char *)networkGlobals->initParams.scoreServer, &(networkGlobals->domainNameResolution));
|
||||
if (toolerror()) {
|
||||
networkGlobals->gameNetworkState = GAME_NETWORK_LOOKUP_FAILED;
|
||||
networkGlobals->errorCode = toolerror();
|
||||
|
@ -572,7 +574,7 @@ static void handleRequestScores(void)
|
|||
md5Init(&(networkGlobals->hashWorkBlock));
|
||||
md5Append(&(networkGlobals->hashWorkBlock), (Pointer)&(networkGlobals->secrets), sizeof(networkGlobals->secrets));
|
||||
md5Append(&(networkGlobals->hashWorkBlock), (Pointer)&(networkGlobals->highScoreRequest.highScoreRequest), sizeof(networkGlobals->highScoreRequest.highScoreRequest));
|
||||
md5Finish(&(networkGlobals->hashWorkBlock), &(networkGlobals->highScoreRequest.md5Digest[0]));
|
||||
md5Finish(&(networkGlobals->hashWorkBlock), (Pointer)&(networkGlobals->highScoreRequest.md5Digest[0]));
|
||||
|
||||
networkGlobals->errorCode = TCPIPWriteTCP(networkGlobals->ipid, (Pointer)&(networkGlobals->highScoreRequest), sizeof(networkGlobals->highScoreRequest), FALSE, FALSE);
|
||||
if (networkGlobals->errorCode != tcperrOK) {
|
||||
|
@ -637,7 +639,7 @@ static void handleSetHighScore(void)
|
|||
md5Init(&(networkGlobals->hashWorkBlock));
|
||||
md5Append(&(networkGlobals->hashWorkBlock), (Pointer)&(networkGlobals->secrets), sizeof(networkGlobals->secrets));
|
||||
md5Append(&(networkGlobals->hashWorkBlock), (Pointer)&(setHighScoreRequest.setHighScoreRequest), sizeof(setHighScoreRequest.setHighScoreRequest));
|
||||
md5Finish(&(networkGlobals->hashWorkBlock), &(setHighScoreRequest.md5Digest[0]));
|
||||
md5Finish(&(networkGlobals->hashWorkBlock), (Pointer)&(setHighScoreRequest.md5Digest[0]));
|
||||
|
||||
networkGlobals->errorCode = TCPIPWriteTCP(networkGlobals->ipid, (Pointer)&setHighScoreRequest, sizeof(setHighScoreRequest), FALSE, FALSE);
|
||||
if (networkGlobals->errorCode != tcperrOK) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define _GUARD_PROJECTBuGS_FILEglobalScores_
|
||||
|
||||
|
||||
#include <types.h>
|
||||
#include <TYPES.h>
|
||||
|
||||
|
||||
typedef struct tHighScore
|
||||
|
|
|
@ -14,13 +14,16 @@
|
|||
#include "main.h"
|
||||
|
||||
|
||||
|
||||
#if __ORCAC__
|
||||
segment "loadSounds";
|
||||
#endif
|
||||
|
||||
static void loadSound(Word addr, Word soundNum)
|
||||
{
|
||||
Handle handle = LoadResource(rRawSound, soundNum);
|
||||
HLock(handle);
|
||||
WriteRamBlock(*handle, addr, GetHandleSize(handle));
|
||||
WriteRamBlock(*handle, addr, (Word)GetHandleSize(handle));
|
||||
HUnlock(handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define _GUARD_PROJECTBuGS_FILEloadSounds_
|
||||
|
||||
|
||||
#include <types.h>
|
||||
#include <TYPES.h>
|
||||
|
||||
|
||||
extern void loadSpiderSound(Word addr);
|
||||
|
|
12
BuGS/main.c
12
BuGS/main.c
|
@ -7,9 +7,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <orca.h>
|
||||
#include <Memory.h>
|
||||
#include <Locator.h>
|
||||
#include <MiscTool.h>
|
||||
|
@ -17,13 +20,14 @@
|
|||
#include "main.h"
|
||||
#include "game.h"
|
||||
#include "globalScores.h"
|
||||
#include "settings.h"
|
||||
#include "tileData.h"
|
||||
|
||||
|
||||
/* Defines and macros */
|
||||
|
||||
#define TOOLFAIL(string) \
|
||||
if (toolerror()) SysFailMgr(toolerror(), "\p" string "\n\r Error Code -> $");
|
||||
if (toolerror()) SysFailMgr(toolerror(), (Pointer)"\p" string "\n\r Error Code -> $");
|
||||
|
||||
|
||||
/* Globals */
|
||||
|
@ -74,7 +78,7 @@ void scorePosition(unsigned int position, unsigned int numberOfScores)
|
|||
int i;
|
||||
|
||||
sprintf(globalScoreInfo, " %u OF %u SCORES", position, numberOfScores);
|
||||
for (i = strlen(globalScoreInfo); i < sizeof(globalScoreInfo); i++) {
|
||||
for (i = (int)strlen(globalScoreInfo); i < sizeof(globalScoreInfo); i++) {
|
||||
globalScoreInfo[i] = ' ';
|
||||
}
|
||||
globalScoreInfo[GAME_NUM_TILES_WIDE] = '\0';
|
||||
|
@ -124,7 +128,7 @@ int main(void)
|
|||
SetMouse(transparent);
|
||||
|
||||
highScoreInitParams.userId = myUserId;
|
||||
highScoreInitParams.scoreServer = "\p" NETWORK_SERVER;
|
||||
highScoreInitParams.scoreServer = (const char *)"\p" NETWORK_SERVER;
|
||||
highScoreInitParams.scorePort = NETWORK_SERVERPORT;
|
||||
highScoreInitParams.secret1 = NETWORK_SERVERSECRET1;
|
||||
highScoreInitParams.secret2 = NETWORK_SERVERSECRET2;
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
* Copyright © 2021 Jeremy Rand. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gsos.h>
|
||||
#include <orca.h>
|
||||
#include <Memory.h>
|
||||
|
||||
#include "game.h"
|
||||
#include "globalScores.h"
|
||||
#include "settings.h"
|
||||
#include "tileData.h"
|
||||
|
@ -62,8 +65,9 @@ static Handle filenameHandle = NULL;
|
|||
|
||||
// Implementation
|
||||
|
||||
#if __ORCAC__
|
||||
segment "settings";
|
||||
|
||||
#endif
|
||||
|
||||
static void allocateFilenameHandle(void)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef _GUARD_PROJECTBuGS_FILEsettings_
|
||||
#define _GUARD_PROJECTBuGS_FILEsettings_
|
||||
|
||||
#include <types.h>
|
||||
#include <TYPES.h>
|
||||
|
||||
|
||||
extern unsigned int myUserId;
|
||||
|
|
Loading…
Reference in New Issue
Block a user