Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to C99 so irsim builds with modern C compilers #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ config:
tcllibrary: modules
@echo --- making Tcl shared-object libraries
for dir in ${PROGRAMS}; do \
(cd $$dir && ${MAKE} tcl-main); done
${MAKE} -C $$dir tcl-main; done

mains: modules
@echo --- making main programs
for dir in ${PROGRAMS}; do \
(cd $$dir && ${MAKE} main); done
${MAKE} -C $$dir main; done

modules:
@echo --- making modules
for dir in ${MODULES}; do \
(cd $$dir && ${MAKE} module); done
${MAKE} -C $$dir module; done

libs:
@echo --- making libraries
for dir in ${LIBRARIES}; do \
(cd $$dir && ${MAKE} lib); done
${MAKE} -C $$dir lib; done

depend:
for dir in ${MODULES} ${PROGRAMS}; do \
(cd $$dir && ${MAKE} depend); done
${MAKE} -C $$dir depend; done

install: $(INSTALL_TARGET)

Expand All @@ -63,9 +63,9 @@ install-irsim:

install-real: install-dirs
for dir in ${INSTALL_CAD_DIRS}; do \
(cd $$dir && ${MAKE} install); done
${MAKE} -C $$dir install; done
for dir in ${PROGRAMS}; do \
(cd $$dir && ${MAKE} install); done
${MAKE} -C $$dir install; done

install-tcl-dirs:
${IRSIMDIR}/scripts/mkdirs $(DESTDIR)${INSTALL_BINDIR} $(DESTDIR)${INSTALL_MANDIR} \
Expand All @@ -82,11 +82,11 @@ install-tcl:

install-tcl-real: install-tcl-dirs
for dir in ${INSTALL_CAD_DIRS} ${PROGRAMS}; do \
(cd $$dir && ${MAKE} install-tcl); done
${MAKE} -C $$dir install-tcl; done

clean:
for dir in ${MODULES} ${PROGRAMS} ${UNUSED_MODULES}; do \
(cd $$dir && ${MAKE} clean); done
${MAKE} -C $$dir clean; done
${RM} *.log

distclean:
Expand All @@ -109,7 +109,7 @@ dist:

clean-mains:
for dir in ${PROGRAMS}; do \
(cd $$dir && ${RM} $$dir}; done
(cd $$dir && ${RM} $$dir); done

tags:
${RM} tags
1 change: 1 addition & 0 deletions analyzer/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* *********************************************************************
*/

#include <ctype.h>
#include "ana.h"
#include "ana_glob.h"
#include "graphics.h"
Expand Down
9 changes: 3 additions & 6 deletions analyzer/defaults.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ private Assoc assoc[] =

private char *irsim = "irsim";

public char *GetXDefault( key )
int key;
public char *GetXDefault( int key )
{
char *val;

Expand All @@ -78,17 +77,15 @@ public char *GetXDefault( key )
}


public int IsDefault( key, val )
int key;
char *val;
public int IsDefault( int key, char *val )
{
if( assoc[ key ].defl == val )
return( TRUE );
return( (strcmp( assoc[ key ].defl, val ) == 0) ? TRUE : FALSE );
}


public char *ProgDefault( key )
public char *ProgDefault( int key )
{
return( assoc[ key ].defl );
}
18 changes: 6 additions & 12 deletions analyzer/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ private int x_server = 0;
private int x_helper = 0; /* process id of helper process */
public Func FGetEvent = NULL; /* used also in thread.c */

public void WindowResize( ev )
XConfigureEvent *ev;
public void WindowResize( XConfigureEvent *ev )
{
int ret;

Expand All @@ -75,8 +74,7 @@ public void WindowResize( ev )
}


public void WindowExposed( event )
XExposeEvent *event;
public void WindowExposed( XExposeEvent *event )
{
BBox box;

Expand All @@ -88,8 +86,7 @@ public void WindowExposed( event )
}


public void HandleButton( ev )
XButtonEvent *ev;
public void HandleButton( XButtonEvent *ev )
{
if( WITHINY( ev->y, scrollBox ) )
DoScrollBar( ev );
Expand Down Expand Up @@ -123,8 +120,7 @@ public void HandleButton( ev )
}


public void HandleKey( ev )
XKeyEvent *ev;
public void HandleKey( XKeyEvent *ev )
{
char buff[ 40 ];
int nChars, i;
Expand Down Expand Up @@ -312,8 +308,7 @@ private void DisabledEventHandler()

#ifdef NEED_HELPER

private int StartHelper( fd )
int fd;
private int StartHelper( int fd )
{
extern char *cad_bin, *getenv();
static char helper_name[] = "anXhelper";
Expand Down Expand Up @@ -355,8 +350,7 @@ private int StartHelper( fd )

#endif /* NEED_HELPER */

public int InitHandler( fd )
int fd;
public int InitHandler( int fd )
{
int flags;
char *senv;
Expand Down
13 changes: 3 additions & 10 deletions analyzer/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ private char bots_bits[3][2] = { 0x7, 0x5, 0x3, 0x1, 0x6, 0x4 };
#define SAME_COLOR( A, B ) \
( (A).red == (B).red and (A).green == (B).green and (A).blue == (B).blue )

private int GetColor( key, colors, ndefined )
int key;
XColor colors[];
int ndefined;
private int GetColor( int key, XColor colors[], int ndefined )
{
char *s;
XColor *color;
Expand Down Expand Up @@ -222,10 +219,7 @@ private void InitBitmaps()
}


private Cursor MakeCursor( fg, bg, curs, mask, w, h, x, y )
XColor *fg, *bg;
char *curs, *mask;
int w, h;
private Cursor MakeCursor( XColor *fg, XColor *bg, char *curs, char *mask, int w, int h, int x, int y )
{
Pixmap pcurs, pmask;
Cursor cu;
Expand Down Expand Up @@ -269,8 +263,7 @@ private void InitCursors()
}


public void InitGraphics(font)
Font font;
public void InitGraphics(Font font)
{
XGCValues gcv;
unsigned long mask;
Expand Down
5 changes: 5 additions & 0 deletions analyzer/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ extern Display *display;
extern Window window;
extern Func FGetEvent;

extern void HandleButton( XButtonEvent *ev );
extern void HandleKey( XKeyEvent *ev );
extern void WindowExposed( XExposeEvent *event );
extern void WindowResize( XConfigureEvent *ev );

pthread_t xloop_thread = 0;
Func EventHandlerPtr = NULL;

Expand Down
Loading