mirror of
https://github.com/abakh/nbsdgames.git
synced 2025-02-02 15:07:27 -05:00
fix c99 problems
This commit is contained in:
parent
f37dbbe829
commit
fddccbfa5c
@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define RED 3
|
#define RED 3
|
||||||
#define CYAN 2
|
#define CYAN 2
|
||||||
#define ENGLISH_LETTERS 26
|
#define ENGLISH_LETTERS 26
|
||||||
typedef signed char byte;
|
|
||||||
typedef unsigned char bitbox;
|
typedef unsigned char bitbox;
|
||||||
|
|
||||||
bool multiplayer;
|
bool multiplayer;
|
||||||
|
3
byte.h
Normal file
3
byte.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#ifndef byte
|
||||||
|
#define byte signed char //ugly, i know
|
||||||
|
#endif
|
@ -28,7 +28,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define ALT_IMG 2
|
#define ALT_IMG 2
|
||||||
#define ALT_NRM 3
|
#define ALT_NRM 3
|
||||||
#define WIN 100000
|
#define WIN 100000
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
byte py,px;//cursor
|
byte py,px;//cursor
|
||||||
byte cy,cx;//selected(choosen) piece
|
byte cy,cx;//selected(choosen) piece
|
||||||
|
2
common.h
2
common.h
@ -14,7 +14,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define FOPEN_FAIL -10
|
#define FOPEN_FAIL -10
|
||||||
typedef signed char byte;
|
|
||||||
FILE* score_file;
|
FILE* score_file;
|
||||||
byte score_write(const char* path, long wscore, byte save_to_num){// only saves the top 10, returns the place in the chart
|
byte score_write(const char* path, long wscore, byte save_to_num){// only saves the top 10, returns the place in the chart
|
||||||
score_file=fopen(path,"r");
|
score_file=fopen(path,"r");
|
||||||
|
6
config.h
6
config.h
@ -48,3 +48,9 @@
|
|||||||
}
|
}
|
||||||
#define usleep(x) microsleep(x)
|
#define usleep(x) microsleep(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef signed char byte;
|
||||||
|
|
||||||
|
#ifndef M_PI //i don't know why tf, but it happens
|
||||||
|
#define M_PI 3.1415
|
||||||
|
#endif
|
||||||
|
1
darrt.c
1
darrt.c
@ -30,7 +30,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define SHOTS_WHEN_STARTING 10
|
#define SHOTS_WHEN_STARTING 10
|
||||||
|
|
||||||
#define randint(a,b) ((a)+(rand()%((b+1)-(a))))
|
#define randint(a,b) ((a)+(rand()%((b+1)-(a))))
|
||||||
typedef signed char byte;
|
|
||||||
#ifdef Plan9
|
#ifdef Plan9
|
||||||
int usleep(long usec) {
|
int usleep(long usec) {
|
||||||
int second = usec/1000000;
|
int second = usec/1000000;
|
||||||
|
@ -16,7 +16,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
#ifdef NO_VLA
|
#ifdef NO_VLA
|
||||||
|
1
fisher.c
1
fisher.c
@ -27,7 +27,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define HLEN LEN/2
|
#define HLEN LEN/2
|
||||||
#define WID 80
|
#define WID 80
|
||||||
#define HWID WID/2
|
#define HWID WID/2
|
||||||
typedef signed char byte;
|
|
||||||
#ifdef Plan9
|
#ifdef Plan9
|
||||||
int usleep(long usec) {
|
int usleep(long usec) {
|
||||||
int second = usec/1000000;
|
int second = usec/1000000;
|
||||||
|
1
jewels.c
1
jewels.c
@ -24,7 +24,6 @@ TODO make it like puyo puyo instead of the remake of what i poorly remembered*/
|
|||||||
#define WID 19
|
#define WID 19
|
||||||
#define DELAY 2
|
#define DELAY 2
|
||||||
#define SAVE_TO_NUM 10
|
#define SAVE_TO_NUM 10
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
chtype board[LEN][WID];
|
chtype board[LEN][WID];
|
||||||
chtype colors[6]={0};
|
chtype colors[6]={0};
|
||||||
|
@ -17,7 +17,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
typedef signed char byte;
|
|
||||||
typedef unsigned char ubyte;
|
typedef unsigned char ubyte;
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
|
@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define MINWID 40
|
#define MINWID 40
|
||||||
#define MAXWID 80
|
#define MAXWID 80
|
||||||
enum {UP=1,RIGHT,DOWN,LEFT,FLIGHT,NOTRAIL,BOMB,SPAWN,STOP,SUPERFOOD,TRAIL};
|
enum {UP=1,RIGHT,DOWN,LEFT,FLIGHT,NOTRAIL,BOMB,SPAWN,STOP,SUPERFOOD,TRAIL};
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs and usleep is a POSIX function */
|
/* The Plan9 compiler can not handle VLAs and usleep is a POSIX function */
|
||||||
#ifdef NO_VLA
|
#ifdef NO_VLA
|
||||||
|
1
mines.c
1
mines.c
@ -20,7 +20,6 @@ compile with -lncurses
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define FLAG 9
|
#define FLAG 9
|
||||||
#define UNCLEAR 10
|
#define UNCLEAR 10
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
#ifdef NO_VLA //The Plan9 compiler can not handle VLAs
|
#ifdef NO_VLA //The Plan9 compiler can not handle VLAs
|
||||||
#define len 8
|
#define len 8
|
||||||
|
@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define MINWID 40
|
#define MINWID 40
|
||||||
#define MAXWID 80
|
#define MAXWID 80
|
||||||
enum {UP=1,RIGHT,DOWN,LEFT,FOOD,SUPERFOOD,TRAP};
|
enum {UP=1,RIGHT,DOWN,LEFT,FOOD,SUPERFOOD,TRAP};
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
#ifdef NO_VLA
|
#ifdef NO_VLA
|
||||||
|
1
pipes.c
1
pipes.c
@ -30,7 +30,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define SAVE_TO_NUM 10
|
#define SAVE_TO_NUM 10
|
||||||
#define SY 0
|
#define SY 0
|
||||||
#define SX 7
|
#define SX 7
|
||||||
typedef signed char byte;
|
|
||||||
typedef unsigned char bitbox;
|
typedef unsigned char bitbox;
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
|
@ -25,7 +25,6 @@ compile with -lncurses
|
|||||||
#define LEFT 8
|
#define LEFT 8
|
||||||
#define VISITED 16
|
#define VISITED 16
|
||||||
#define CARROT 32
|
#define CARROT 32
|
||||||
typedef signed char byte;
|
|
||||||
typedef unsigned char bitbox;
|
typedef unsigned char bitbox;
|
||||||
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
|
@ -24,7 +24,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#define DEAD 0
|
#define DEAD 0
|
||||||
#define ALIVE 1
|
#define ALIVE 1
|
||||||
#define RED 2
|
#define RED 2
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
int level;
|
int level;
|
||||||
byte py,px;
|
byte py,px;
|
||||||
|
@ -16,8 +16,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
typedef signed char byte;
|
#include "config.h"
|
||||||
|
|
||||||
byte py,px;//cursor
|
byte py,px;//cursor
|
||||||
const char piece[2] = {'O','X'};
|
const char piece[2] = {'O','X'};
|
||||||
char game[8][8];//main board
|
char game[8][8];//main board
|
||||||
|
@ -40,7 +40,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
|
|
||||||
enum {UP=0,RIGHT,DOWN,LEFT};
|
enum {UP=0,RIGHT,DOWN,LEFT};
|
||||||
enum {BLOCK=0,SURVIVAL,MIRROR,IMITATE};
|
enum {BLOCK=0,SURVIVAL,MIRROR,IMITATE};
|
||||||
typedef signed char byte;
|
|
||||||
/* The Plan9 compiler can not handle VLAs */
|
/* The Plan9 compiler can not handle VLAs */
|
||||||
#ifdef NO_VLA
|
#ifdef NO_VLA
|
||||||
#define len 36
|
#define len 36
|
||||||
|
1
sos.c
1
sos.c
@ -18,7 +18,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define NOTHING 123
|
#define NOTHING 123
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
#ifdef NO_VLA
|
#ifdef NO_VLA
|
||||||
#define len 5
|
#define len 5
|
||||||
|
1
sudoku.c
1
sudoku.c
@ -19,7 +19,6 @@ NOTE: This program is only made for entertainment porpuses. The puzzles are gene
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
typedef signed char byte;
|
|
||||||
|
|
||||||
byte _wait=0, waitcycles=0;//apparently 'wait' conflicts with a variable in a library macOS includes by default
|
byte _wait=0, waitcycles=0;//apparently 'wait' conflicts with a variable in a library macOS includes by default
|
||||||
byte py,px;
|
byte py,px;
|
||||||
|
Loading…
Reference in New Issue
Block a user