1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2024-06-08 17:20:41 +00:00

fix c99 problems

This commit is contained in:
Your Name 2021-07-18 21:39:29 +00:00
parent f37dbbe829
commit fddccbfa5c
20 changed files with 12 additions and 19 deletions

View File

@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#define RED 3
#define CYAN 2
#define ENGLISH_LETTERS 26
typedef signed char byte;
typedef unsigned char bitbox;
bool multiplayer;

3
byte.h Normal file
View File

@ -0,0 +1,3 @@
#ifndef byte
#define byte signed char //ugly, i know
#endif

View File

@ -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_NRM 3
#define WIN 100000
typedef signed char byte;
byte py,px;//cursor
byte cy,cx;//selected(choosen) piece

View File

@ -14,7 +14,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#include <unistd.h>
#include "config.h"
#define FOPEN_FAIL -10
typedef signed char byte;
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
score_file=fopen(path,"r");

View File

@ -48,3 +48,9 @@
}
#define usleep(x) microsleep(x)
#endif
typedef signed char byte;
#ifndef M_PI //i don't know why tf, but it happens
#define M_PI 3.1415
#endif

View File

@ -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 randint(a,b) ((a)+(rand()%((b+1)-(a))))
typedef signed char byte;
#ifdef Plan9
int usleep(long usec) {
int second = usec/1000000;

View File

@ -16,7 +16,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#include <time.h>
#include <signal.h>
#include "config.h"
typedef signed char byte;
/* The Plan9 compiler can not handle VLAs */
#ifdef NO_VLA

View File

@ -27,7 +27,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#define HLEN LEN/2
#define WID 80
#define HWID WID/2
typedef signed char byte;
#ifdef Plan9
int usleep(long usec) {
int second = usec/1000000;

View File

@ -24,7 +24,6 @@ TODO make it like puyo puyo instead of the remake of what i poorly remembered*/
#define WID 19
#define DELAY 2
#define SAVE_TO_NUM 10
typedef signed char byte;
chtype board[LEN][WID];
chtype colors[6]={0};

View File

@ -17,7 +17,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#include <time.h>
#include <signal.h>
#include "config.h"
typedef signed char byte;
typedef unsigned char ubyte;
/* The Plan9 compiler can not handle VLAs */

View File

@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#define MINWID 40
#define MAXWID 80
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 */
#ifdef NO_VLA

View File

@ -20,7 +20,6 @@ compile with -lncurses
#include "config.h"
#define FLAG 9
#define UNCLEAR 10
typedef signed char byte;
#ifdef NO_VLA //The Plan9 compiler can not handle VLAs
#define len 8

View File

@ -25,7 +25,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#define MINWID 40
#define MAXWID 80
enum {UP=1,RIGHT,DOWN,LEFT,FOOD,SUPERFOOD,TRAP};
typedef signed char byte;
/* The Plan9 compiler can not handle VLAs */
#ifdef NO_VLA

View File

@ -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 SY 0
#define SX 7
typedef signed char byte;
typedef unsigned char bitbox;
/* The Plan9 compiler can not handle VLAs */

View File

@ -25,7 +25,6 @@ compile with -lncurses
#define LEFT 8
#define VISITED 16
#define CARROT 32
typedef signed char byte;
typedef unsigned char bitbox;
/* The Plan9 compiler can not handle VLAs */

View File

@ -24,7 +24,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#define DEAD 0
#define ALIVE 1
#define RED 2
typedef signed char byte;
int level;
byte py,px;

View File

@ -16,8 +16,7 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#include <stdlib.h>
#include <signal.h>
#include <stdbool.h>
typedef signed char byte;
#include "config.h"
byte py,px;//cursor
const char piece[2] = {'O','X'};
char game[8][8];//main board

View File

@ -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 {BLOCK=0,SURVIVAL,MIRROR,IMITATE};
typedef signed char byte;
/* The Plan9 compiler can not handle VLAs */
#ifdef NO_VLA
#define len 36

1
sos.c
View File

@ -18,7 +18,6 @@ You should have received a copy of the CC0 Public Domain Dedication along with t
#include <signal.h>
#include "config.h"
#define NOTHING 123
typedef signed char byte;
#ifdef NO_VLA
#define len 5

View File

@ -19,7 +19,6 @@ NOTE: This program is only made for entertainment porpuses. The puzzles are gene
#include <signal.h>
#include <math.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 py,px;