Please review any and all PUBLIC repositories, groups and associate files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Commit 3a3418a0 authored by Mike Collins's avatar Mike Collins

RIGAL Compiler work on Ubuntu 64-bit machines allowing the -m32 compile flag...

RIGAL Compiler work on Ubuntu 64-bit machines allowing the -m32 compile flag along with warnings cleanup.
parent e27bd695
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -15,7 +15,7 @@ extern Void savea PV(); ...@@ -15,7 +15,7 @@ extern Void savea PV();
extern Void closea PV(); extern Void closea PV();
extern Void opens PP((Char d_drive)); extern void opens (char d_drive);
/********* loads input f : file specifikation string /********* loads input f : file specifikation string
output e : s_pointer of loud object **/ output e : s_pointer of loud object **/
......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include <ctype.h>
/******** GLOBRIG.H ******/ /******** GLOBRIG.H ******/
#define Char char #define Char char
#define boolean char #define boolean char
...@@ -9,13 +15,8 @@ ...@@ -9,13 +15,8 @@
#define Static static #define Static static
#define Local static #define Local static
#define FileNotFound 1 #define FileNotFound 1
char* __M__;
char* __M__;
#define Malloc(n) ((__M__ = malloc(n)) ? __M__ : (char*)_OutMem()) #define Malloc(n) ((__M__ = malloc(n)) ? __M__ : (char*)_OutMem())
#include <ctype.h>
#include <stdio.h>
#include <string.h>
/* #include <malloc.h> commented out 8/24/09 */
/*#include <stdlib.h>*/
...@@ -4,16 +4,12 @@ ...@@ -4,16 +4,12 @@
# #
# C compiler to use (Compiler path can be changed by the user) # C compiler to use (Compiler path can be changed by the user)
CCFLAGS = -g #CCFLAGS = -g -DLE -m32 -I/usr/include -I../include
PCA = cc $(CCFLAGS) -c -D xsun=1 -I../include/ CCFLAGS = -m32 -I/usr/include -I../include
# Specify -DLE for Little-endian architectures (Big-endian is default)! #PCA = cc $(CCFLAGS) -D STATIC_CCFLAGS='"$(CCFLAGS)"' -c xsun=1 -I../include/ -I/usr/include
# Specify -Dbbs for BBS-version of scaner (LaTeX version is default)! PCA = cc $(CCFLAGS) -D STATIC_CCFLAGS='"$(CCFLAGS)"' -c
# math lib for sin, cos, sqrt etc.
LIBS = -lm LIBS = -lm
# This is for sin, cos, sqrt etc.
# Other things are usually not changed by the user
.INIT: check$(rig)
# ------------------------------------------------- # -------------------------------------------------
# MACRO DEFINITIONS # MACRO DEFINITIONS
...@@ -49,6 +45,12 @@ normal: bins ../lib/riglib.a ../bin/anrig ../bin/genrigd ../bin/rig_lint test ...@@ -49,6 +45,12 @@ normal: bins ../lib/riglib.a ../bin/anrig ../bin/genrigd ../bin/rig_lint test
bins: bin ../bin/rc ../bin/ic ../bin/v bins: bin ../bin/rc ../bin/ic ../bin/v
bin: bin:
-mkdir ../bin -mkdir ../bin
#rigal_scratch:#
# rm -rf ../rigal_scratch
# cp -r ../rigv4_scripts ../rigal_scratch#
# mv ../rigal_scratch/Preloaded-examples-release-4 ../rigal_scratch/examples
../bin/rc:$(RCF_SRC) rc_.o ../bin/rc:$(RCF_SRC) rc_.o
cc $(CCFLAGS) -o ../bin/rc rc_.o $(RCF_SRC) cc $(CCFLAGS) -o ../bin/rc rc_.o $(RCF_SRC)
...@@ -106,10 +108,10 @@ bin: ...@@ -106,10 +108,10 @@ bin:
test: ../test/rigcrf.rig ../bin/rc ../lib/riglib.a ../bin/anrig ../bin/genrigd test: ../test/rigcrf.rig ../bin/rc ../lib/riglib.a ../bin/anrig ../bin/genrigd
(cd ../test;\ (cd ../test;\
$(rig)/rc rigcrf;\ ../bin/rc rigcrf;\
$(rig)/ic rigcrf rigcrf;\ ../bin/ic rigcrf rigcrf;\
$(rig)/rc rigcrf -c;\ ../bin/rc rigcrf -c;\
rigcrf rigcrf) ./rigcrf rigcrf)
##------------------ Hidden possibilities ##------------------ Hidden possibilities
z: anrigz genrigz z: anrigz genrigz
...@@ -135,35 +137,31 @@ tar: clean ...@@ -135,35 +137,31 @@ tar: clean
cp ../rigsc.$(VERSION).tar.Z /info/ftp/pub/labs/pelab/rigal/ cp ../rigsc.$(VERSION).tar.Z /info/ftp/pub/labs/pelab/rigal/
##-------------------------------------- ##--------------------------------------
clean: clean:
mv ../test/rigcrf.rig . -rm -f *.o */*.o *.RC2 */*.RC2 *.RC4 */*.RC4 */*.rsc
-rm -f *.o */*.o *.RC2 */*.RC2 *.RC4 */*.RC4 */*.rsc ../lint/*.o ../lint/*.RC2 ../lint/*.RC4 \ -rm -f ../lint/*.o ../lint/*.RC2 ../lint/*.RC4
../examples/hanoi ../*/*.rsc ../*/*.out ../*/*/*.out ../test/* -rm -f ../*/*.rsc ../*/*.out ../*/*/*.out
mv rigcrf.rig ../test/ -rm -f ../test/rigcrf ../test/rigcrf.crf ../test/rigcrf.crt
-rm -f ../test/xcrg_0.c
##--------------------------------------
clean_bkups:
-rm -rf ../bin_bkup ../lib_bkup
##-------------------------------------- ##--------------------------------------
.c.o: $(INCLIB_SRC) .c.o: $(INCLIB_SRC)
$(PCA) $< -o $@ $(PCA) $< -o $@
check:
@echo '********************************************************'
@echo '*' User ERROR: you have not set \"rig\" environment variable to $(PWD)/../bin
@echo '********************************************************'
____FATAL___ERROR___
check$(rig):
@echo VARIABLE rig have been set to $(rig)
@echo ---------------------------------------
##---------------------------------------- ##----------------------------------------
# Prepare distribution ## Prepare distribution
mkdist$(RFILE)$(RDIR): #mkdist$(RFILE)$(RDIR):
@echo '*** to prepare for distribution write make mkdist RFILE=fff RDIR=/u/vaden/xyz/xyz/' # @echo '*** to prepare for distribution write make mkdist RFILE=fff RDIR=/u/vaden/xyz/xyz/'
mkdist: #mkdist:
(cd $(RDIR);\ # (cd $(RDIR);\
$(rig)/rc $(RFILE);\ # ../bin/rc $(RFILE);\
$(rig)/anrig;\ # ../bin/anrig;\
$(rig)/genrigd S -p N.TMP;\ # ../bin/genrigd S -p N.TMP;\
/bin/rm *.RC2 *.RC4 *.TMP) # /bin/rm *.RC2 *.RC4 *.TMP)
cp ../include/* $(RDIR) # cp ../include/* $(RDIR)
cp $(DISTLIB) $(RDIR) # cp $(DISTLIB) $(RDIR)
(cd $(RDIR);\ # (cd $(RDIR);\
echo 'cc -O -w -D xsun=1 ' $(DISTLIB) ' xc*.c -o ' $(RFILE) $(LIBS) > cmd) # echo 'cc -O -w -D xsun=1 ' $(DISTLIB) ' xc*.c -o ' $(RFILE) $(LIBS) > cmd)
mkdist2: #mkdist2:
(cd $(RDIR);\ # (cd $(RDIR);\
cc -O -w -D xsun=1 $(DISTLIB) xc*.c -o $(RFILE) $(LIBS) ;/bin/rm *.o) ### cc -O -w -D xsun=1 $(DISTLIB) xc*.c -o $(RFILE) $(LIBS) ;/bin/rm *.o)
...@@ -950,7 +950,6 @@ long p, ot; ...@@ -950,7 +950,6 @@ long p, ot;
ptr_ opptr; /* pointer po s-kodu operatora */ ptr_ opptr; /* pointer po s-kodu operatora */
a aadr; /* a-adres atoma */ a aadr; /* a-adres atoma */
a opcel; /* rawen opptr.cel*/ a opcel; /* rawen opptr.cel*/
boolean succmakeflag; /* uspehno oformleno imq */
/* ========= osnownaq procedura ========== */ /* ========= osnownaq procedura ========== */
...@@ -1225,7 +1224,6 @@ long *rez; ...@@ -1225,7 +1224,6 @@ long *rez;
ptr_ p2, stmtbeg, p3; ptr_ p2, stmtbeg, p3;
boolean islist; boolean islist;
/* deskriptor atoma -selektora */ /* deskriptor atoma -selektora */
long n;
atomdescriptor *WITH; atomdescriptor *WITH;
...@@ -1567,11 +1565,18 @@ ptr_ *pl, *p; ...@@ -1567,11 +1565,18 @@ ptr_ *pl, *p;
y = pl->cel; y = pl->cel;
if (y != null_) { if (y != null_) {
pointr(y, &s2.sa); pointr(y, &s2.sa);
*success = (s.svd->dtype == variable || *success = (
s.svd->dtype == idvariable && s2.sad->dtype == idatom || (
s.svd->dtype == nvariable && s2.sad->dtype == number); (s.svd->dtype == variable ) )||
(
(s.svd->dtype == idvariable) &&
(s2.sad->dtype == idatom ) )||
(
(s.svd->dtype == nvariable ) &&
(s2.sad->dtype == number) )
);
} else } else
*success = (s.svd->dtype != idvariable && s.svd->dtype != nvariable); *success = ( (s.svd->dtype != idvariable) && (s.svd->dtype != nvariable) );
/* if y=null */ /* if y=null */
} /* pl.nel<>0 */ } /* pl.nel<>0 */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifdef MIPSEL #ifdef MIPSEL
/* For DEC variant, ULTRIX computers, /* For DEC variant, ULTRIX computers,
/* Little endian variant of MIPS architecture: Little endian variant of MIPS architecture:
changed ... */ changed ... */
#define dos 1 #define dos 1
#endif #endif
...@@ -45,8 +45,7 @@ ...@@ -45,8 +45,7 @@
#define m_wrong "1014 - Internal error - wrong Spointer" #define m_wrong "1014 - Internal error - wrong Spointer"
static Void mess(messstr) static Void mess(char *messstr)
Char *messstr;
{ {
printf("\n--------------------------\n"); printf("\n--------------------------\n");
printf("Paging manager : %s\n", messstr); printf("Paging manager : %s\n", messstr);
...@@ -191,7 +190,9 @@ dinformtype dinform; ...@@ -191,7 +190,9 @@ dinformtype dinform;
Void init_dinform() Void init_dinform()
{ {
char dt; char dt;
_REC_dinformtype *WITH;
#ifdef bad_sets
long SET[4]; long SET[4];
long SET1[4]; long SET1[4];
long SET2[4]; long SET2[4];
...@@ -199,19 +200,16 @@ Void init_dinform() ...@@ -199,19 +200,16 @@ Void init_dinform()
long SET5[5], SET6[5]; long SET5[5], SET6[5];
long SET7[9]; long SET7[9];
_REC_dinformtype *WITH;
#ifdef bad_sets
P_addsetr(P_expset(digit, 0L), '0', '9'); P_addsetr(P_expset(digit, 0L), '0', '9');
P_addset(P_expset(SET5, 0L), '~'); P_addset(P_expset( SET5, 0L), '~');
P_addset(SET5, '|'); P_addset( SET5, '|');
P_addset(SET5, '`'); P_addset( SET5, '`');
P_addset(SET5, '{'); P_addset( SET5, '{');
P_setunion(letter, P_setunion(SET6, P_setunion(letter, P_setunion( SET6,
P_setunion(SET4, P_setunion(SET2, P_addset(P_expset(SET, 0L), '_'), P_setunion( SET4, P_setunion( SET2, P_addset(P_expset(SET, 0L), '_'),
P_addsetr(P_expset(SET1, 0L), 'A', 'Z')), P_addsetr(P_expset( SET1, 0L), 'A', 'Z')),
P_addsetr(P_expset(SET3, 0L), 'a', 'z')), P_addsetr(P_expset( SET3, 0L), 'a', 'z')),
P_addset(SET5, '}')), P_addsetr(P_expset(SET7, 0L), 128, 255)); P_addset( SET5, '}')), P_addsetr(P_expset( SET7, 0L), 128, 255));
/* p2c: defsun3.z, line 805: Note: /* p2c: defsun3.z, line 805: Note:
* Line breaker spent 0.7+0.19 seconds, 5000 tries on line 1049 [251] */ * Line breaker spent 0.7+0.19 seconds, 5000 tries on line 1049 [251] */
/* all these additional characters are added only for compatibility /* all these additional characters are added only for compatibility
...@@ -259,9 +257,7 @@ longint adiscread, adiscwrite, adiscpage, sdiscread, sdiscwrite, sdiscpage; ...@@ -259,9 +257,7 @@ longint adiscread, adiscwrite, adiscpage, sdiscread, sdiscwrite, sdiscpage;
/*******************************************************/ /*******************************************************/
Static Void nextsp(sptr, length) static void nextsp(sa_pointer *sptr,word length)
sa_pointer *sptr;
word length;
{ {
newstru *WITH; /* pazofpa -> newstru, 5-jul-93 */ newstru *WITH; /* pazofpa -> newstru, 5-jul-93 */
WITH = &sptr->newstruct; WITH = &sptr->newstruct;
...@@ -278,8 +274,7 @@ word length; ...@@ -278,8 +274,7 @@ word length;
/*******************************************************/ /*******************************************************/
/**** pointx ieksejam vajadzibam - loti lidzigs vecajam pointr(s) ****/ /**** pointx ieksejam vajadzibam - loti lidzigs vecajam pointr(s) ****/
Static long pointx(e1) static long pointx(long e1)
long e1;
{ {
sa_pointer mm; sa_pointer mm;
...@@ -302,7 +297,7 @@ long e1; ...@@ -302,7 +297,7 @@ long e1;
/******************************************** opena *****/ /******************************************** opena *****/
Void opena() void opena()
{ {
long i; long i;
a_block *WITH; a_block *WITH;
...@@ -328,8 +323,7 @@ struct LOC_putatm { ...@@ -328,8 +323,7 @@ struct LOC_putatm {
long intpage; long intpage;
} ; } ;
Local Void pagecheck(LINK) static void pagecheck(struct LOC_putatm *LINK)
struct LOC_putatm *LINK;
{ {
long j, k, l, garums; long j, k, l, garums;
a_block *WITH; a_block *WITH;
...@@ -383,9 +377,7 @@ _L99: ; ...@@ -383,9 +377,7 @@ _L99: ;
/*********************************** putatm(ad,na,e) *****/ /*********************************** putatm(ad,na,e) *****/
Void putatm(ad, na_, e) void putatm(char *ad, long na_,long *e)
Char *ad;
long na_, *e;
{ {
struct LOC_putatm V; struct LOC_putatm V;
long i; long i;
...@@ -421,10 +413,7 @@ long na_, *e; ...@@ -421,10 +413,7 @@ long na_, *e;
/************************************* pointa(e,ad,na) *****/ /************************************* pointa(e,ad,na) *****/
Void pointa(e, ad, na) void pointa(long e,char *ad,long *na)
long e;
Char *ad;
long *na;
{ {
long i, j; long i, j;
sa_pointer atbilde; sa_pointer atbilde;
...@@ -441,7 +430,7 @@ long *na; ...@@ -441,7 +430,7 @@ long *na;
(*na)++; (*na)++;
} }
} else { } else {
WITH = &a_bufp[atbilde.struct_.page]; WITH = &a_bufp[(int) atbilde.struct_.page];
*na = WITH->inform[atbilde.struct_.offset - 1]; *na = WITH->inform[atbilde.struct_.offset - 1];
j = atbilde.struct_.offset + 1; j = atbilde.struct_.offset + 1;
FORLIM = *na; FORLIM = *na;
...@@ -473,8 +462,7 @@ Void closes() ...@@ -473,8 +462,7 @@ Void closes()
/******************************************** vola *****/ /******************************************** vola *****/
Void vola(dr, dw, dp) void vola(long *dr,long *dw,long *dp)
long *dr, *dw, *dp;
{ {
*dr = adiscread; *dr = adiscread;
*dw = adiscwrite; *dw = adiscwrite;
...@@ -484,8 +472,7 @@ long *dr, *dw, *dp; ...@@ -484,8 +472,7 @@ long *dr, *dw, *dp;
/** * * * * * * s - m a n a g e r * * * * * * * * * * **/ /** * * * * * * s - m a n a g e r * * * * * * * * * * **/
/******************************************** opens *****/ /******************************************** opens *****/
Void opens(d_drive) void opens(char d_drive)
Char d_drive;
{ {
s_buf *ptr; s_buf *ptr;
long k; long k;
...@@ -514,8 +501,7 @@ Char d_drive; ...@@ -514,8 +501,7 @@ Char d_drive;
/****************************************** pointr (e1,e2) *****/ /****************************************** pointr (e1,e2) *****/
Void pointr(e1, e2) void pointr(long e1,long *e2)
long e1, *e2;
{ {
sa_pointer sap; sa_pointer sap;
/*printf(" pointr %p \n",e1);*/ /*printf(" pointr %p \n",e1);*/
...@@ -527,8 +513,7 @@ long e1, *e2; ...@@ -527,8 +513,7 @@ long e1, *e2;
/****************************************** points (e1,e2) *****/ /****************************************** points (e1,e2) *****/
Void points(e1, e2) void points(long e1,long *e2)
long e1, *e2;
{ {
sa_pointer sap; sa_pointer sap;
...@@ -540,8 +525,7 @@ long e1, *e2; ...@@ -540,8 +525,7 @@ long e1, *e2;
/***************************************** gets1 (e1,e2) *****/ /***************************************** gets1 (e1,e2) *****/
Void gets1(e1, e2) void gets1(long *e1,long *e2)
long *e1, *e2;
{ {
absadr absa; absadr absa;
object_type *WITH; object_type *WITH;
...@@ -559,8 +543,7 @@ long *e1, *e2; ...@@ -559,8 +543,7 @@ long *e1, *e2;
/***************************************** gets2 (e1,e2) *****/ /***************************************** gets2 (e1,e2) *****/
Void gets2(e1, e2) void gets2(long *e1,long *e2)
long *e1, *e2;
{ {
absadr absa; absadr absa;
object_type *WITH; object_type *WITH;
...@@ -578,8 +561,7 @@ long *e1, *e2; ...@@ -578,8 +561,7 @@ long *e1, *e2;
/***************************************** gets5 (e1,e2) *****/ /***************************************** gets5 (e1,e2) *****/
Void gets5(e1, e2) void gets5(long *e1,long *e2)
long *e1, *e2;
{ {
long i; long i;
absadr absa; absadr absa;
...@@ -596,9 +578,7 @@ long *e1, *e2; ...@@ -596,9 +578,7 @@ long *e1, *e2;
/*************************************** loads (f,e) *****/ /*************************************** loads (f,e) *****/
Void loads(f, e) void loads(char *f, long *e)
Char *f;
long *e;
{ {
FILE *infile; FILE *infile;
sa_pointer bulta1, bulta2, rab1; sa_pointer bulta1, bulta2, rab1;
...@@ -789,8 +769,7 @@ struct LOC_saves { ...@@ -789,8 +769,7 @@ struct LOC_saves {
} buffer; } buffer;
} ; } ;
Local Void move_(LINK) static void move_(struct LOC_saves *LINK)
struct LOC_saves *LINK;
{ {
long i, garums; long i, garums;
object_type *WITH; object_type *WITH;
...@@ -812,8 +791,7 @@ struct LOC_saves *LINK; ...@@ -812,8 +791,7 @@ struct LOC_saves *LINK;
nextsp(&LINK->bulta2, (int)(garums + 2)); nextsp(&LINK->bulta2, (int)(garums + 2));
} }
Local Void writeblock(LINK) static void writeblock(struct LOC_saves *LINK)
struct LOC_saves *LINK;
{ {
fwrite(LINK->buffer.U3.b1, sizeof(x512), 1, LINK->outfile); fwrite(LINK->buffer.U3.b1, sizeof(x512), 1, LINK->outfile);
/*** write 1 ***/ /*** write 1 ***/
...@@ -821,9 +799,7 @@ struct LOC_saves *LINK; ...@@ -821,9 +799,7 @@ struct LOC_saves *LINK;
/*************************************** saves (f,e) *****/ /*************************************** saves (f,e) *****/
Void saves(f, e) void saves(char *f,long *e)
Char *f;
long *e;
{ {
struct LOC_saves V; struct LOC_saves V;
long i, j, k; long i, j, k;
...@@ -1007,8 +983,7 @@ struct LOC_savesn { ...@@ -1007,8 +983,7 @@ struct LOC_savesn {
} buffer; } buffer;
} ; } ;
Local Void move__(LINK) static void move__(struct LOC_savesn *LINK)
struct LOC_savesn *LINK;
{ {
long i, garums; long i, garums;
object_type *WITH; object_type *WITH;
...@@ -1027,8 +1002,7 @@ struct LOC_savesn *LINK; ...@@ -1027,8 +1002,7 @@ struct LOC_savesn *LINK;
nextsp(&LINK->bulta2, (int)garums); nextsp(&LINK->bulta2, (int)garums);
} }
Local Void writeblock_(LINK) static void writeblock_(struct LOC_savesn *LINK)
struct LOC_savesn *LINK;
{ {
fwrite(LINK->buffer.U3.b1, sizeof(x512), 1, LINK->outfile); fwrite(LINK->buffer.U3.b1, sizeof(x512), 1, LINK->outfile);
...@@ -1038,9 +1012,7 @@ struct LOC_savesn *LINK; ...@@ -1038,9 +1012,7 @@ struct LOC_savesn *LINK;
/*************************************** savesn (f,e) *****/ /*************************************** savesn (f,e) *****/
Void savesn(f, e) void savesn(char *f, long *e)
Char *f;
long *e;
{ {
struct LOC_savesn V; struct LOC_savesn V;
long i, j, k; long i, j, k;
...@@ -1200,8 +1172,7 @@ _Lara: ...@@ -1200,8 +1172,7 @@ _Lara:
/*************************************** vols *****/ /*************************************** vols *****/
Void vols(dr, dw, dp) void vols(long *dr,long *dw,long *dp)
long *dr, *dw, *dp;
{ {
*dr = sdiscread; *dr = sdiscread;
*dw = sdiscwrite; *dw = sdiscwrite;
...@@ -1216,8 +1187,7 @@ struct LOC_reopen { ...@@ -1216,8 +1187,7 @@ struct LOC_reopen {
absadr p2, p3; absadr p2, p3;
} ; } ;
Local Void move___(LINK) static void move___(struct LOC_reopen *LINK)
struct LOC_reopen *LINK;
{ {
long i, garums; long i, garums;
object_type *WITH; object_type *WITH;
...@@ -1238,8 +1208,7 @@ struct LOC_reopen *LINK; ...@@ -1238,8 +1208,7 @@ struct LOC_reopen *LINK;