mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-21 03:29:25 +00:00
Removed references to library <time.h>
This commit is contained in:
parent
0ca69fce81
commit
37d0fee589
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
/* Initilize Compiler Variables */
|
/* Initilize Compiler Variables */
|
||||||
void init(void) {
|
void init(void) {
|
||||||
initim(); //Initialize Elapsed Time
|
|
||||||
DEBUG("Initializing Compiler Variables\n",0)
|
DEBUG("Initializing Compiler Variables\n",0)
|
||||||
concnt = 0; //Number of Constants Defined
|
concnt = 0; //Number of Constants Defined
|
||||||
varcnt = 0; //Number of Variables in Table
|
varcnt = 0; //Number of Variables in Table
|
||||||
|
16
src/common.c
16
src/common.c
@ -7,11 +7,8 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
struct timespec curtim; //Current Time
|
|
||||||
|
|
||||||
/* Error - Print Input File name & position and exit */
|
/* Error - Print Input File name & position and exit */
|
||||||
void exterr(int errnum) {
|
void exterr(int errnum) {
|
||||||
fprintf(stderr, "Line %d Column %d of File %s\n", curlin, curcol, inpnam);
|
fprintf(stderr, "Line %d Column %d of File %s\n", curlin, curcol, inpnam);
|
||||||
@ -29,19 +26,6 @@ void expctd(char *expstr) {
|
|||||||
/* Print current position in file */
|
/* Print current position in file */
|
||||||
void prtpos(void) { if (inpnam[0]) printf("(%s: %d,%d) ", inpnam, curlin, curcol); }
|
void prtpos(void) { if (inpnam[0]) printf("(%s: %d,%d) ", inpnam, curlin, curcol); }
|
||||||
|
|
||||||
/* Initialize elapsed time counter */
|
|
||||||
void initim(void) {
|
|
||||||
timespec_get (&curtim, TIME_UTC);
|
|
||||||
bgntim = curtim.tv_sec;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Print elapsed time */
|
|
||||||
void prttim(void) {
|
|
||||||
timespec_get (&curtim, TIME_UTC);
|
|
||||||
printf("[%d", curtim.tv_sec - bgntim);
|
|
||||||
printf(".%06d]",curtim.tv_nsec/1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set comment to string */
|
/* Set comment to string */
|
||||||
void setcmt(char *s) { strcpy(cmtasm, s); }
|
void setcmt(char *s) { strcpy(cmtasm, s); }
|
||||||
|
|
||||||
|
@ -41,10 +41,8 @@
|
|||||||
#define TRUE -1
|
#define TRUE -1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
|
|
||||||
void initim(); //Initialize elapsed time counter
|
|
||||||
void prtpos(); //Print current file name and position
|
void prtpos(); //Print current file name and position
|
||||||
void prttim(); //Print elapsed time
|
#define DEBUG(fmt, val) {if (debug) {prtpos(); printf(fmt, val);}}
|
||||||
#define DEBUG(fmt, val) {if (debug) {prtpos(); prttim(); printf(fmt, val);}}
|
|
||||||
#define DETAIL(fmt, val) {if (debug) printf(fmt, val);}
|
#define DETAIL(fmt, val) {if (debug) printf(fmt, val);}
|
||||||
#define ERROR(fmt, val, err) {fprintf(stderr, fmt, val);exterr(err);}
|
#define ERROR(fmt, val, err) {fprintf(stderr, fmt, val);exterr(err);}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user