mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-27 09:09:10 +00:00
fix some compiler warnings (#423)
* Pedantic C compilers want an extern declaration separate from initialization * Remove duplicate definitions for fns in initdspdefs.h from display.h * Remove misleading comments on structure member offsets and reorder to minimize padding
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
cat <<EOF
|
||||
#include <time.h>
|
||||
time_t MDate = $(date +%s);
|
||||
extern const time_t MDate;
|
||||
const time_t MDate = $(date +%s);
|
||||
EOF
|
||||
|
||||
@@ -74,13 +74,4 @@ extern DLword *DisplayRegion68k;
|
||||
#undef DISPLAYBUFFER
|
||||
#endif /* XWINDOW */
|
||||
|
||||
void flush_display_buffer();
|
||||
void flush_display_lineregion(UNSIGNED x, DLword *ybase, UNSIGNED w, UNSIGNED h);
|
||||
void flush_display_region(int x, int y, int w, int h);
|
||||
void flush_display_ptrregion(DLword *ybase, UNSIGNED bitoffset, UNSIGNED w, UNSIGNED h);
|
||||
|
||||
#ifdef BYTESWAP
|
||||
void byte_swapped_displayregion(int x, int y, int w, int h);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -82,17 +82,17 @@ typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||
} INTSTAT2;
|
||||
|
||||
struct state {
|
||||
DLword *ivar; /* + 0 */
|
||||
DLword *pvar; /* + 4 */
|
||||
DLword *csp; /* + 8 */
|
||||
LispPTR tosvalue; /* + 12 */
|
||||
ByteCode *currentpc; /* + 16 */
|
||||
struct fnhead *currentfunc; /* + 20*/
|
||||
DLword *endofstack; /* + 24*/
|
||||
UNSIGNED irqcheck; /* + 28 */
|
||||
UNSIGNED irqend; /* + 32 */
|
||||
LispPTR scratch_cstk; /* + 34 */
|
||||
int errorexit; /* + 38 */
|
||||
DLword *ivar;
|
||||
DLword *pvar;
|
||||
DLword *csp;
|
||||
ByteCode *currentpc;
|
||||
struct fnhead *currentfunc;
|
||||
DLword *endofstack;
|
||||
UNSIGNED irqcheck;
|
||||
UNSIGNED irqend;
|
||||
LispPTR tosvalue;
|
||||
LispPTR scratch_cstk;
|
||||
int errorexit;
|
||||
};
|
||||
|
||||
/***** Get_DLword(ptr) ptr is char* ***/
|
||||
@@ -226,17 +226,17 @@ typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||
} INTSTAT2;
|
||||
|
||||
struct state {
|
||||
DLword *ivar; /* + 0 */
|
||||
DLword *pvar; /* + 4 */
|
||||
DLword *csp; /* + 8 */
|
||||
LispPTR tosvalue; /* + 12 */
|
||||
ByteCode *currentpc; /* + 16 */
|
||||
struct fnhead *currentfunc; /* + 20*/
|
||||
DLword *endofstack; /* + 24*/
|
||||
UNSIGNED irqcheck; /* + 28 */
|
||||
UNSIGNED irqend; /* + 32 */
|
||||
LispPTR scratch_cstk; /* + 34 */
|
||||
int errorexit; /* + 38 */
|
||||
DLword *ivar;
|
||||
DLword *pvar;
|
||||
DLword *csp;
|
||||
ByteCode *currentpc;
|
||||
struct fnhead *currentfunc;
|
||||
DLword *endofstack;
|
||||
UNSIGNED irqcheck;
|
||||
UNSIGNED irqend;
|
||||
LispPTR tosvalue;
|
||||
LispPTR scratch_cstk;
|
||||
int errorexit;
|
||||
};
|
||||
|
||||
/* Fetching 2 bytes to make a word -- always do it the hard way */
|
||||
|
||||
@@ -111,7 +111,7 @@ LispPTR *fixp_value(LispPTR *ptr) {
|
||||
#define PAGES_IN_MBYTE 2048
|
||||
|
||||
void init_ifpage(int sysout_size) {
|
||||
extern time_t MDate;
|
||||
extern const time_t MDate;
|
||||
extern int DisplayType;
|
||||
extern int Storage_expanded;
|
||||
int new_lastvmem;
|
||||
|
||||
@@ -246,7 +246,7 @@ int flushing = FALSE; /* see dbprint.h if set, all debug/trace printing will cal
|
||||
extern DspInterface currentdsp;
|
||||
#endif /* DOS || XWINDOW */
|
||||
|
||||
extern time_t MDate;
|
||||
extern const time_t MDate;
|
||||
extern int nokbdflag;
|
||||
extern int nomouseflag;
|
||||
#ifdef DOS
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
int main(void) {
|
||||
long dtime;
|
||||
time(&dtime);
|
||||
printf("long MDate= %ld;\n", dtime);
|
||||
printf("extern const long MDate;\n", dtime);
|
||||
printf("const long MDate = %ld;\n", dtime);
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
@@ -56,7 +57,8 @@ int main(void) {
|
||||
*/
|
||||
gettimeofday(&time, NULL);
|
||||
printf("#include <time.h>\n");
|
||||
printf("time_t MDate= %ld;\n", (long)time.tv_sec);
|
||||
printf("extern const time_t MDate;\n");
|
||||
printf("const time_t MDate = %ld;\n", (long)time.tv_sec);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user