From 1be49e5a4783f3682af04beec504a1d5233eb75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Wed, 20 May 2020 08:51:42 +0200 Subject: [PATCH 01/20] MUI parts fixed. --- build/Makefile.axrt | 4 +- build/lexer.c | 10 ++ src/args.c | 22 ++- src/gui.c | 317 ++++++++++++++++++++++---------------------- src/lexer.l | 10 ++ 5 files changed, 190 insertions(+), 173 deletions(-) diff --git a/build/Makefile.axrt b/build/Makefile.axrt index aefdcdd6..63e3e859 100644 --- a/build/Makefile.axrt +++ b/build/Makefile.axrt @@ -12,7 +12,7 @@ LDFLAGS = -specs=/usr/lib/x86_64-linux-gnu/axrt.specs CGEN = -O0 -std=gnu99 -DAMIGA CINC = -I /usr/include/axrt -I . -I $(VPATH) CDEF = -D_DEFAULT_SOURCE -D_GNU_SOURCE -D__AMIGADATE__="\"($(DATE))\"" $(CEXT) -CFLAGS = $(CINC) $(CGEN) $(CDEF) -D__AROS__ -g -O0 -I/usr/include/axrt +CFLAGS = $(CINC) $(CGEN) $(CDEF) -D__AROS__ -D__AXRT__ -g -O0 -I/usr/include/axrt $(EXE): $(OBJ) parser.o lexer.o $(STARTUP_OBJ) /usr/lib/x86_64-linux-gnu/axrt.ld $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) @@ -21,7 +21,7 @@ parser.o: parser.c $(CC) $(CINC) $(CDEF) $(CGEN) -c $< -DYYERROR_VERBOSE lexer.o: lexer.c - $(CC) $(CINC) $(CDEF) $(CGEN) -c $< + $(CC) $(CINC) $(CDEF) $(CGEN) -D__AXRT__ -c $< parser.c: parser.y $(YACC) $(YFLAGS) -d $< -o $@ diff --git a/build/lexer.c b/build/lexer.c index 11ddf4c3..195ba64a 100644 --- a/build/lexer.c +++ b/build/lexer.c @@ -3412,8 +3412,18 @@ int main(int argc, char **argv) // Assume failure. int ret = -1; +#ifdef __AXRT__ + (void) argc; + (void) argv; + + // Temp AxRT workaround until argument handling in AxRT is implemented. + char *argv_[] = {"Installer", "axrt.script", NULL}; + // Initialize the argument handling. + if(arg_init(2, argv_)) +#else if(arg_init(argc, argv)) +#endif { yyscan_t lexer; diff --git a/src/args.c b/src/args.c index 5482cb8b..d1f8bec1 100644 --- a/src/args.c +++ b/src/args.c @@ -90,26 +90,17 @@ static bool arg_post(void) //------------------------------------------------------------------------------ static bool arg_cli(int argc, char **argv) { - #if defined(AMIGA) + // Temp AxRT workaround until argument handling in AxRT is implemented. + #if defined(AMIGA) && !defined(__AXRT__) // Not used on Amiga. (void) argc; (void) argv; - // AxRT test ---> - DBG_PRINT("argc:%d\n", argc); - DBG_PRINT("argv[0]:%s\n", *argv); - DBG_PRINT("template:%s\n", tr(S_ARGS)); - // AxRT test <--- - // Use the builtin commandline parser. struct RDArgs *rda = (struct RDArgs *) ReadArgs(tr(S_ARGS), (IPTR *) args, NULL); if(!rda) { - // AxRT test ---> - HERE; - // AxRT test <--- - // Invalid or missing arguments. fputs(tr(S_ARGS), stderr); return false; @@ -248,8 +239,13 @@ bool arg_init(int argc, char **argv) // Invoked from CLI or WB. bool init = argc ? arg_cli(argc, argv) : arg_wb(argv); - // Go to script working directory and return. - return init && args[ARG_HOMEDIR] && !chdir(args[ARG_HOMEDIR]); + // Go to script working directory and return. Temp AxRT workaround until + // argument handling in AxRT is implemented. + return init && args[ARG_HOMEDIR] + #ifndef __AXRT__ + && !chdir(args[ARG_HOMEDIR]) + #endif + ; } //------------------------------------------------------------------------------ diff --git a/src/gui.c b/src/gui.c index 58c05517..2d14a8e6 100644 --- a/src/gui.c +++ b/src/gui.c @@ -68,7 +68,7 @@ typedef LONG IPTR; # ifndef __VBCC__ # define DoSuperNew(C,O,...) DoSuperNewTags(C,O,NULL,__VA_ARGS__) #else -APTR STDARGS DoSuperNew(struct IClass *cl, APTR obj, ULONG tag1, ...) +APTR STDARGS DoSuperNew(struct IClass *cl, APTR obj, IPTR tag1, ...) { return (IPTR) DoSuperMethod(cl, obj, OM_NEW, &tag1, NULL); } @@ -167,7 +167,7 @@ CLASS_DEF(IG) //------------------------------------------------------------------------------ struct MUIP_IG_Init { - ULONG MethodID; + IPTR MethodID; }; //------------------------------------------------------------------------------ @@ -175,14 +175,14 @@ struct MUIP_IG_Init //------------------------------------------------------------------------------ struct MUIP_IG_Welcome { - ULONG MethodID; - ULONG Message; - ULONG Level; - ULONG Log; - ULONG Pretend; - ULONG MinLevel; - ULONG NoPretend; - ULONG NoLog; + IPTR MethodID; + IPTR Message; + IPTR Level; + IPTR Log; + IPTR Pretend; + IPTR MinLevel; + IPTR NoPretend; + IPTR NoLog; }; //------------------------------------------------------------------------------ @@ -190,12 +190,12 @@ struct MUIP_IG_Welcome //------------------------------------------------------------------------------ struct MUIP_IG_CopyFilesStart { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG List; - ULONG Confirm; - ULONG Back; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR List; + IPTR Confirm; + IPTR Back; }; //------------------------------------------------------------------------------ @@ -203,10 +203,10 @@ struct MUIP_IG_CopyFilesStart //------------------------------------------------------------------------------ struct MUIP_IG_CopyFilesSetCur { - ULONG MethodID; - ULONG File; - ULONG NoGauge; - ULONG Back; + IPTR MethodID; + IPTR File; + IPTR NoGauge; + IPTR Back; }; //------------------------------------------------------------------------------ @@ -214,8 +214,8 @@ struct MUIP_IG_CopyFilesSetCur //------------------------------------------------------------------------------ struct MUIP_IG_Exit { - ULONG MethodID; - ULONG Message; + IPTR MethodID; + IPTR Message; }; //------------------------------------------------------------------------------ @@ -223,8 +223,8 @@ struct MUIP_IG_Exit //------------------------------------------------------------------------------ struct MUIP_IG_Complete { - ULONG MethodID; - ULONG Progress; + IPTR MethodID; + IPTR Progress; }; //------------------------------------------------------------------------------ @@ -232,8 +232,8 @@ struct MUIP_IG_Complete //------------------------------------------------------------------------------ struct MUIP_IG_CopyFilesAdd { - ULONG MethodID; - ULONG File; + IPTR MethodID; + IPTR File; }; //------------------------------------------------------------------------------ @@ -241,10 +241,10 @@ struct MUIP_IG_CopyFilesAdd //------------------------------------------------------------------------------ struct MUIP_IG_Confirm { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Back; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Back; }; //------------------------------------------------------------------------------ @@ -252,9 +252,9 @@ struct MUIP_IG_Confirm //------------------------------------------------------------------------------ struct MUIP_IG_Message { - ULONG MethodID; - ULONG Message; - ULONG Back; + IPTR MethodID; + IPTR Message; + IPTR Back; }; //------------------------------------------------------------------------------ @@ -262,8 +262,8 @@ struct MUIP_IG_Message //------------------------------------------------------------------------------ struct MUIP_IG_Finish { - ULONG MethodID; - ULONG Message; + IPTR MethodID; + IPTR Message; }; //------------------------------------------------------------------------------ @@ -271,8 +271,8 @@ struct MUIP_IG_Finish //------------------------------------------------------------------------------ struct MUIP_IG_Working { - ULONG MethodID; - ULONG Message; + IPTR MethodID; + IPTR Message; }; //------------------------------------------------------------------------------ @@ -280,10 +280,10 @@ struct MUIP_IG_Working //------------------------------------------------------------------------------ struct MUIP_IG_Effect { - ULONG MethodID; - ULONG Effect; - ULONG ColorStart; - ULONG ColorEnd; + IPTR MethodID; + IPTR Effect; + IPTR ColorStart; + IPTR ColorEnd; }; //------------------------------------------------------------------------------ @@ -291,8 +291,8 @@ struct MUIP_IG_Effect //------------------------------------------------------------------------------ struct MUIP_IG_CloseMedia { - ULONG MethodID; - ULONG MediaID; + IPTR MethodID; + IPTR MediaID; }; //------------------------------------------------------------------------------ @@ -300,10 +300,10 @@ struct MUIP_IG_CloseMedia //------------------------------------------------------------------------------ struct MUIP_IG_SetMedia { - ULONG MethodID; - ULONG MediaID; - ULONG Action; - ULONG Parameter; + IPTR MethodID; + IPTR MediaID; + IPTR Action; + IPTR Parameter; }; //------------------------------------------------------------------------------ @@ -311,10 +311,10 @@ struct MUIP_IG_SetMedia //------------------------------------------------------------------------------ struct MUIP_IG_ShowMedia { - ULONG MethodID; - ULONG MediaID; - ULONG Media; - ULONG Action; + IPTR MethodID; + IPTR MediaID; + IPTR Media; + IPTR Action; }; //------------------------------------------------------------------------------ @@ -322,10 +322,10 @@ struct MUIP_IG_ShowMedia //------------------------------------------------------------------------------ struct MUIP_IG_ShowPicture { - ULONG MethodID; - ULONG MediaID; - ULONG Picture; - ULONG Action; + IPTR MethodID; + IPTR MediaID; + IPTR Picture; + IPTR Action; }; //------------------------------------------------------------------------------ @@ -333,8 +333,8 @@ struct MUIP_IG_ShowPicture //------------------------------------------------------------------------------ struct MUIP_IG_Abort { - ULONG MethodID; - ULONG Message; + IPTR MethodID; + IPTR Message; }; //------------------------------------------------------------------------------ @@ -342,13 +342,13 @@ struct MUIP_IG_Abort //------------------------------------------------------------------------------ struct MUIP_IG_Radio { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Names; - ULONG Default; - ULONG Back; - ULONG Select; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Names; + IPTR Default; + IPTR Back; + IPTR Select; }; //------------------------------------------------------------------------------ @@ -356,12 +356,12 @@ struct MUIP_IG_Radio //------------------------------------------------------------------------------ struct MUIP_IG_Bool { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Yes; - ULONG No; - ULONG Back; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Yes; + IPTR No; + IPTR Back; }; //------------------------------------------------------------------------------ @@ -369,12 +369,12 @@ struct MUIP_IG_Bool //------------------------------------------------------------------------------ struct MUIP_IG_String { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Default; - ULONG Back; - ULONG String; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Default; + IPTR Back; + IPTR String; }; //------------------------------------------------------------------------------ @@ -382,14 +382,14 @@ struct MUIP_IG_String //------------------------------------------------------------------------------ struct MUIP_IG_Number { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Min; - ULONG Max; - ULONG Default; - ULONG Back; - ULONG Number; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Min; + IPTR Max; + IPTR Default; + IPTR Back; + IPTR Number; }; //------------------------------------------------------------------------------ @@ -397,13 +397,13 @@ struct MUIP_IG_Number //------------------------------------------------------------------------------ struct MUIP_IG_CheckBoxes { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Names; - ULONG Default; - ULONG Back; - ULONG Bitmap; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Names; + IPTR Default; + IPTR Back; + IPTR Bitmap; }; //------------------------------------------------------------------------------ @@ -411,16 +411,16 @@ struct MUIP_IG_CheckBoxes //------------------------------------------------------------------------------ struct MUIP_IG_AskFile { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG NewPath; - ULONG Disk; - ULONG Assign; - ULONG Default; - ULONG Dir; - ULONG Back; - ULONG File; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR NewPath; + IPTR Disk; + IPTR Assign; + IPTR Default; + IPTR Dir; + IPTR Back; + IPTR File; }; //------------------------------------------------------------------------------ @@ -428,11 +428,11 @@ struct MUIP_IG_AskFile //------------------------------------------------------------------------------ struct MUIP_IG_PageSet { - ULONG MethodID; - ULONG Message; - ULONG Help; - ULONG Top; - ULONG Bottom; + IPTR MethodID; + IPTR Message; + IPTR Help; + IPTR Top; + IPTR Bottom; }; //------------------------------------------------------------------------------ @@ -440,7 +440,7 @@ struct MUIP_IG_PageSet //------------------------------------------------------------------------------ struct MUIP_IG_GetCustomScreen { - ULONG MethodID; + IPTR MethodID; }; //------------------------------------------------------------------------------ @@ -448,11 +448,11 @@ struct MUIP_IG_GetCustomScreen //------------------------------------------------------------------------------ struct MUIP_IG_GetScreenProp { - ULONG MethodID; - ULONG Width; - ULONG Height; - ULONG Depth; - ULONG Colors; + IPTR MethodID; + IPTR Width; + IPTR Height; + IPTR Depth; + IPTR Colors; }; //------------------------------------------------------------------------------ @@ -460,13 +460,13 @@ struct MUIP_IG_GetScreenProp //------------------------------------------------------------------------------ struct MUIP_IG_GetWindowProp { - ULONG MethodID; - ULONG Width; - ULONG Height; - ULONG Upper; - ULONG Lower; - ULONG Left; - ULONG Right; + IPTR MethodID; + IPTR Width; + IPTR Height; + IPTR Upper; + IPTR Lower; + IPTR Left; + IPTR Right; }; //------------------------------------------------------------------------------ @@ -506,10 +506,10 @@ struct MUIP_IG_GetWindowProp //------------------------------------------------------------------------------ // IGTrans - [PRIVATE] Translate button input to GUI response value -// Input: ULONG signal: - +// Input: IPTR signal: - // Return: GUI response value //------------------------------------------------------------------------------ -static ULONG IGTrans(ULONG signal) +static IPTR IGTrans(IPTR signal) { switch(signal) { @@ -539,13 +539,13 @@ static ULONG IGTrans(ULONG signal) //------------------------------------------------------------------------------ // IGWait - [PRIVATE] Wait for notification(s) -// Input: ULONG notif: Start notification value -// ULONG range: Number of values to check for +// Input: IPTR notif: Start notification value +// IPTR range: Number of values to check for // Return: Notifcation val. / zero on return id quit //------------------------------------------------------------------------------ -static ULONG IGWait(Object *obj, ULONG notif, ULONG range) +static IPTR IGWait(Object *obj, IPTR notif, IPTR range) { - ULONG sig = 0, ret = 0, n; + IPTR sig = 0, ret = 0, n; // Set cycle chain for all buttons within the notification range. for(n = 0; n < range; n++) @@ -584,7 +584,7 @@ static ULONG IGWait(Object *obj, ULONG notif, ULONG range) ret = DoMethod(_app(obj), MUIM_Application_NewInput, &sig); // Enter the message loop. - while(ret != (ULONG) MUIV_Application_ReturnID_Quit) + while(ret != (IPTR) MUIV_Application_ReturnID_Quit) { // Iterate over all signals that we're waiting for. for(n = 0; n < range; n++) @@ -645,7 +645,7 @@ static ULONG IGWait(Object *obj, ULONG notif, ULONG range) //------------------------------------------------------------------------------ MUIDSP IGInit(Class *cls, Object *obj) { - static ULONG i = MUIV_IG_FirstButton; + static IPTR i = MUIV_IG_FirstButton; // Have we already done this? if(i != MUIV_IG_LastButton) @@ -716,7 +716,7 @@ MUIDSP IGPageSet(Class *cls, Object *obj, struct MUIP_IG_PageSet *msg) // Always a valid message string. const char *src = msg->Message ? (const char *) - CAST(msg->Message, const char *) : ""; + msg->Message : ""; // Select top and buttons. set(my->Top, MUIA_Group_ActivePage, msg->Top); @@ -829,11 +829,11 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) // Take minimum user level into account. set(my->ExpertLevel, MUIA_Radio_Active, - *CAST(msg->Level, int32_t *) - 1); + msg->Level - 1); } // Set the current user level. - set(my->UserLevel, MUIA_Radio_Active, *CAST(msg->Level, int32_t *)); + set(my->UserLevel, MUIA_Radio_Active, msg->Level); // Wait for proceed or abort. inp_t rc = IGTrans(IGWait(obj, MUIV_IG_Proceed, 2)); @@ -843,6 +843,7 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) // Get the selected user level value. If we have a minimum user // level of 'average' we're using a different set of radio buttons. // Fetch from the right object and adjust the return value. + // if(msg->MinLevel == 1) { // Minimum user level 'average'. @@ -855,7 +856,7 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) { // Minimum user level 'novice' or 'expert'. get(my->UserLevel, MUIA_Radio_Active, - CAST(msg->Level, int32_t *)); + &msg->Level); } // Disable the pretend choice if the NOPRETEND tooltype is used. The @@ -864,7 +865,7 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) ( my->Pretend, MUIA_Radio_Active, - msg->NoPretend ? 0 : *CAST(msg->Pretend, int32_t *), + msg->NoPretend ? 0 : msg->Pretend, MUIA_Disabled, msg->NoPretend ? TRUE : FALSE, TAG_END ); @@ -875,13 +876,13 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) ( my->Log, MUIA_Radio_Active, - msg->NoLog ? 0 : *CAST(msg->Log, int32_t *), + msg->NoLog ? 0 : msg->Log, MUIA_Disabled, msg->NoLog ? TRUE : FALSE, TAG_END ); // Don't show logging and pretend mode settings to 'Novice' users. - if(*CAST(msg->Level, int32_t *)) + if(msg->Level) { // Show pretend / log page. if(DoMethod(obj, MUIM_IG_PageSet, NULL, @@ -894,9 +895,9 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) { // Get pretend and log settings. get(my->Pretend, MUIA_Radio_Active, - CAST(msg->Pretend, int32_t *)); + &msg->Pretend); get(my->Log, MUIA_Radio_Active, - CAST(msg->Log, int32_t *)); + &msg->Log); } } else @@ -921,10 +922,10 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) //------------------------------------------------------------------------------ // IGDirPart - [PRIVATE] - Return existing dir from random path -// Input: ULONG Path: Random path. -// Return: ULONG: Existing dir from path. +// Input: IPTR Path: Random path. +// Return: IPTR: Existing dir from path. //------------------------------------------------------------------------------ -static ULONG IGDirPart(Class *cls, Object *obj, ULONG Path) +static IPTR IGDirPart(Class *cls, Object *obj, IPTR Path) { struct FileInfoBlock *fib = (struct FileInfoBlock *) AllocDosObject(DOS_FIB, NULL); @@ -976,7 +977,7 @@ static ULONG IGDirPart(Class *cls, Object *obj, ULONG Path) // Restore auto request. p->pr_WindowPtr = w; - return CAST(my->Buf, ULONG); + return CAST(my->Buf, IPTR); } GERR(tr(S_UNER)); @@ -1284,7 +1285,7 @@ MUIDSP IGCopyFilesSetCur(Class *cls, Object *obj, char *file = CAST(msg->File, char *); size_t len = strlen(file); struct TextExtent ext; - static ULONG back; + static IPTR back; // Toggle 'Abort' and 'Back'? if(msg->Back != back) @@ -1299,7 +1300,7 @@ MUIDSP IGCopyFilesSetCur(Class *cls, Object *obj, // Get the number of characters that can be shown given the width of // the gauge and the contents of the string. - ULONG max = TextFit(_rp(my->Progress), file, len, &ext, NULL, 1, + IPTR max = TextFit(_rp(my->Progress), file, len, &ext, NULL, 1, _mwidth(my->Progress), _mheight(my->Progress)); // Do we need to truncate the file string to not wreck the gauge? @@ -1316,7 +1317,7 @@ MUIDSP IGCopyFilesSetCur(Class *cls, Object *obj, // Update progress bar. Text and number. if(!msg->NoGauge) { - ULONG cur = 0; + IPTR cur = 0; // Get current progress. get(my->Progress, MUIA_Gauge_Current, &cur); @@ -1340,7 +1341,7 @@ MUIDSP IGCopyFilesSetCur(Class *cls, Object *obj, if(++n >> 6) { // Wait for tick / abort / exit. - ULONG rs = IGWait(obj, MUIV_IG_Tick, 2); + IPTR rs = IGWait(obj, MUIV_IG_Tick, 2); // Start over or return. if(rs != MUIV_IG_Tick) @@ -1491,7 +1492,7 @@ MUIDSP IGEffect(Class *cls, Object *obj, struct MUIP_IG_Effect *msg) if(s) { // Allocate color vector. - ULONG *cv = calloc(s * 3, sizeof(ULONG)); + IPTR *cv = calloc(s * 3, sizeof(IPTR)); // Release pen and bail on OOM. if(!cv) @@ -1509,9 +1510,9 @@ MUIDSP IGEffect(Class *cls, Object *obj, struct MUIP_IG_Effect *msg) // Compute gradient. while(i < s * 3) { - cv[i++] = ((ULONG) r) << 24; - cv[i++] = ((ULONG) g) << 24; - cv[i++] = ((ULONG) b) << 24; + cv[i++] = ((IPTR) r) << 24; + cv[i++] = ((IPTR) g) << 24; + cv[i++] = ((IPTR) b) << 24; r += rd; g += gd; b += bd; @@ -1574,7 +1575,7 @@ MUIDSP IGCloseMedia(Class *cls, Object *obj, struct MUIP_IG_CloseMedia *msg) (void) cls; // Compute user data value. - ULONG mid = msg->MediaID + MUIA_IG_MediaBase; + IPTR mid = msg->MediaID + MUIA_IG_MediaBase; // Is the media ID valid? if(mid <= MUIA_IG_MediaMax) @@ -1713,7 +1714,7 @@ MUIDSP IGShowPicture(Class *cls, Object *obj, struct MUIP_IG_ShowPicture *msg) { // Default behaviour is to put the window in the center and leave the // size as is. - ULONG xs = 0, ys = 0, yp = MUIV_Window_TopEdge_Centered, + IPTR xs = 0, ys = 0, yp = MUIV_Window_TopEdge_Centered, xp = MUIV_Window_LeftEdge_Centered; // Set size explicitly? @@ -1862,7 +1863,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) { // Get group ID of datatype. struct DataTypeHeader *dth = dtp->dtn_Header; - ULONG gid = dth->dth_GroupID; + IPTR gid = dth->dth_GroupID; // Free datatype resources and release lock. ReleaseDataType(dtp); @@ -1922,7 +1923,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) MUIDSP IGMessage(Class *cls, Object *obj, struct MUIP_IG_Message *msg) { // Set correct page and button combination. - if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, NULL, P_MESSAGE, + if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, NULL, 4/*P_MESSAGE*/, B_PROCEED_ABORT)) { struct IGData *my = INST_DATA(cls, obj); @@ -2195,7 +2196,7 @@ MUIDSP IGString(Class *cls, Object *obj, struct MUIP_IG_String *msg) } // No matter what, get string. - get(my->String, MUIA_String_Contents, CAST(msg->String, ULONG *)); + get(my->String, MUIA_String_Contents, CAST(msg->String, IPTR *)); // Return status. return rc; @@ -2252,7 +2253,7 @@ MUIDSP IGNumber(Class *cls, Object *obj, struct MUIP_IG_Number *msg) } // No matter what, get numerical value. - get(my->Number, MUIA_Numeric_Value, CAST(msg->Number, ULONG *)); + get(my->Number, MUIA_Numeric_Value, CAST(msg->Number, IPTR *)); // Success or halt. return rc; @@ -2366,14 +2367,14 @@ MUIDSP IGCheckBoxes(Class *cls, Object *obj, if(DoMethod(my->Empty, MUIM_Group_InitChange)) { // The return value. - *CAST(msg->Bitmap, ULONG *) = 0; + *CAST(msg->Bitmap, IPTR *) = 0; while(i--) { - ULONG sel = 0; + IPTR sel = 0; get(cb[i], MUIA_Selected, &sel); - *CAST(msg->Bitmap, ULONG *) |= (sel ? (1 << i) : 0); + *CAST(msg->Bitmap, IPTR *) |= (sel ? (1 << i) : 0); DoMethod(my->Empty, OM_REMMEMBER, cb[i]); MUI_DisposeObject(cb[i]); } @@ -2428,7 +2429,7 @@ MUIDSP IGComplete(Class *cls, Object *obj, struct MUIP_IG_Complete *msg) MUIDSP IGConfirm(Class *cls, Object *obj, struct MUIP_IG_Confirm *msg) { struct IGData *my = INST_DATA(cls, obj); - ULONG top = 0, btm = 0, str = 0; + IPTR top = 0, btm = 0, str = 0; // Save the current state of whatever we're showing before we ask for // confirmation. diff --git a/src/lexer.l b/src/lexer.l index 17e1c49f..361cc4d5 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -269,8 +269,18 @@ int main(int argc, char **argv) // Assume failure. int ret = -1; +#ifdef __AXRT__ + (void) argc; + (void) argv; + + // Temp AxRT workaround until argument handling in AxRT is implemented. + char *argv_[] = {"Installer", "axrt.script", NULL}; + // Initialize the argument handling. + if(arg_init(2, argv_)) +#else if(arg_init(argc, argv)) +#endif { yyscan_t lexer; From 4f2ec07c411545ea342f8e40795e1d67f7f8fd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Wed, 20 May 2020 09:30:47 +0200 Subject: [PATCH 02/20] ASL test. --- build/axrt.script | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/axrt.script b/build/axrt.script index 9894cdae..4d966892 100644 --- a/build/axrt.script +++ b/build/axrt.script @@ -1 +1,7 @@ +; Using a custom screen doesn't seem to work. Uncomment to test. +;(effect "center_left" 'horizontal' 1 254) (effect "center_left" 'horizontal' 1 255) ; "","e 36:1:254 36:1:255 1","" +(complete 25) (message "Hello AxRT world!") +(complete 75) +(message ("File:%s" (askfile (default "No file") (prompt "Pick a file") (help "Nope, no help")))) +(complete 100) From f1771955a5ad6189df569b0a8f17e7159f95dde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Wed, 20 May 2020 13:38:24 +0200 Subject: [PATCH 03/20] Crude smooth progressbar. --- build/axrt.script | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/build/axrt.script b/build/axrt.script index 4d966892..d9c9bda9 100644 --- a/build/axrt.script +++ b/build/axrt.script @@ -1,7 +1,25 @@ ; Using a custom screen doesn't seem to work. Uncomment to test. ;(effect "center_left" 'horizontal' 1 254) (effect "center_left" 'horizontal' 1 255) ; "","e 36:1:254 36:1:255 1","" -(complete 25) + +; Silly experiment, smooth progress +(procedure progress start stop delay + ( + (set i start) + (while (<= i stop) + (set i (+ i 1)) + (set j delay) + (while (> j 0) + (set j (- j 1)) + (complete i) + ) + ) + ) +) + +(progress 0 25 2000) (message "Hello AxRT world!") -(complete 75) + +(progress 25 75 2000) (message ("File:%s" (askfile (default "No file") (prompt "Pick a file") (help "Nope, no help")))) -(complete 100) + +(progress 75 100 2000) From 425ddae73efbd1fc9c6a7363c6d5a1afa28b455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 23 May 2020 21:58:05 +0200 Subject: [PATCH 04/20] Version bump. --- dist/InstallerLG installer | 2 +- dist/InstallerLG.guide | 3 +++ dist/aminet/InstallerLG.readme | 2 +- src/version.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/InstallerLG installer b/dist/InstallerLG installer index 659f9cf2..b1a022a9 100644 --- a/dist/InstallerLG installer +++ b/dist/InstallerLG installer @@ -1,4 +1,4 @@ -; $VER: InstallerLG 0.1.0-alpha.47 +; $VER: InstallerLG 0.1.0-alpha.48 ; Install script for InstallerLG (set #app-bin "Installer") diff --git a/dist/InstallerLG.guide b/dist/InstallerLG.guide index 935f0217..a32dd205 100644 --- a/dist/InstallerLG.guide +++ b/dist/InstallerLG.guide @@ -118,6 +118,9 @@ Italian translations. @{B}The complete changelog@{UB} @{B}-----------------------------------------------------------------------@{UB} +@{B}0.1.0-alpha.48 (2020-NOT-YET)@{UB} +- ? + @{B}0.1.0-alpha.47 (2020-05-17)@{UB} - (askstring) and (asknumber) accept missing default in sloppy mode. - (startup) chomps redundant (command) linefeed. diff --git a/dist/aminet/InstallerLG.readme b/dist/aminet/InstallerLG.readme index 51351ca6..51e0cb98 100644 --- a/dist/aminet/InstallerLG.readme +++ b/dist/aminet/InstallerLG.readme @@ -4,7 +4,7 @@ Uploader: rolfkopman@gmail.com (Ola S Type: util/sys Architecture: __ARCH__ Requires: MUI 3.8 -Version: 0.1.0-alpha.47 +Version: 0.1.0-alpha.48 Distribution: Aminet InstallerLG diff --git a/src/version.h b/src/version.h index 149e0432..20553d1b 100644 --- a/src/version.h +++ b/src/version.h @@ -12,7 +12,7 @@ #define MAJOR 44 #define MINOR 10 -#define BUILD 47 +#define BUILD 48 #define PHASE "ALPHA" #define STY(X) #X From 781f585f96c05af56c4ff1c923af24c20789c1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 23 May 2020 23:37:25 +0200 Subject: [PATCH 05/20] CppCheck fixes. --- .travis.yml | 2 +- src/cli.c | 15 +++++++++++---- src/exit.c | 5 +---- src/information.c | 10 +++++----- src/probe.c | 9 ++++----- src/util.c | 4 ++-- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea662480..0a65a240 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: jobs: include: - stage: Cppcheck - script: cd src && for f in *.c; do cppcheck $f; done + script: cd src && cppcheck --enable=all --max-ctu-depth=4096 --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . - stage: Test script: make -C build smoke || (cat build/err.tmp.* 2> /dev/null && false) - stage: Valgrind diff --git a/src/cli.c b/src/cli.c index 90249113..b5b214ea 100644 --- a/src/cli.c +++ b/src/cli.c @@ -355,7 +355,9 @@ inp_t gui_copyfiles_start(const char *msg, const char *hlp, pnode_p lst, bool cn (void)cnf; (void)bck; - printf("Starting file copy %s.\n", msg); + if(msg) { + printf("Starting file copy %s.\n", msg); + } return G_TRUE; } @@ -365,7 +367,9 @@ inp_t gui_copyfiles_setcur(const char *cur, bool nga, bool bck) (void)nga; (void)bck; - printf("Copying files Cur:%s.\n", cur); + if(cur) { + printf("Copying files Cur:%s.\n", cur); + } return G_TRUE; } @@ -401,7 +405,10 @@ inp_t gui_confirm(const char *msg, const char *hlp, bool bck) void gui_error(int line, const char *type, const char *info) { printf("Error of type %s on line %d.", type, line); - printf("Error info: %s", info); + + if(info) { + printf("Error info: %s", info); + } } void gui_effect(int eff, int cl1, int cl2) @@ -418,7 +425,7 @@ inp_t gui_closemedia(int mid) inp_t gui_setmedia(int mid, int act, const char *par) { - printf("Set media with mid %d, act %d and par %s", mid, act, par); + printf("Set media with mid %d, act %d and par %s", mid, act, par ? par : "NONE"); return G_TRUE; } diff --git a/src/exit.c b/src/exit.c index 6373e17e..3e2c127c 100644 --- a/src/exit.c +++ b/src/exit.c @@ -153,11 +153,8 @@ entry_p n_onerror(entry_p contxt) // Zero or more arguments. No options. C_SANE(0, NULL); - // Global context where the user defined procedures are found. - entry_p con = global(contxt); - // Make sure that '@onerror' exists. On out of memory it might be missing. - entry_p *err = con->symbols; + entry_p *err = global(contxt)->symbols; while(exists(*err)) { diff --git a/src/information.c b/src/information.c index 2ad917af..f61118b4 100644 --- a/src/information.c +++ b/src/information.c @@ -276,23 +276,23 @@ entry_p n_working(entry_p contxt) size_t len = strlen(tr(S_WRKN)) + strlen(msg) + 1; // Memory to hold prefix and children. - char *con = DBG_ALLOC(calloc(len, 1)); + char *all = DBG_ALLOC(calloc(len, 1)); - if(!con && PANIC(contxt)) + if(!all && PANIC(contxt)) { free(msg); return end(); } // Concatenate and free buffer. - snprintf(con, len, "%s%s", tr(S_WRKN), msg); + snprintf(all, len, "%s%s", tr(S_WRKN), msg); free(msg); // Show the result. - gui_working(con); + gui_working(all); // Free the final message buffer. - free(con); + free(all); // Success. R_NUM(LG_TRUE); diff --git a/src/probe.c b/src/probe.c index 5300d446..a57c7345 100644 --- a/src/probe.c +++ b/src/probe.c @@ -188,12 +188,11 @@ static cpu_t h_cpu_id(void) //------------------------------------------------------------------------------ static char *h_cpu_name(void) { - char *cpu[] = { "Unknown CPU", "PowerPC", "ARM", "M68000", "M68010", "M68020", - "M68030", "M68040", "M68060", "X86", "X86_64"}; - + char *cpu[X86_64 + 1] = { "Unknown CPU", "PowerPC", "ARM", "M68000", + "M68010", "M68020", "M68030", "M68040", "M68060", + "X86", "X86_64"}; // Trans ID to string. - cpu_t cid = h_cpu_id(); - return cpu[(cid < (sizeof(cpu) / sizeof(cpu[NONE]))) ? cid : NONE]; + return cpu[h_cpu_id()]; } //------------------------------------------------------------------------------ diff --git a/src/util.c b/src/util.c index b29f9702..1a3d1263 100644 --- a/src/util.c +++ b/src/util.c @@ -520,7 +520,7 @@ static bool x_sane(entry_p contxt, type_t type, size_t num) //------------------------------------------------------------------------------ bool c_sane(entry_p contxt, size_t num) { - return contxt && x_sane(contxt, NATIVE, num); + return global(contxt) && x_sane(contxt, NATIVE, num); } //------------------------------------------------------------------------------ @@ -535,7 +535,7 @@ bool c_sane(entry_p contxt, size_t num) //------------------------------------------------------------------------------ bool s_sane(entry_p contxt, size_t num) { - return contxt && contxt->symbols && global(contxt) && + return global(contxt) && contxt->symbols && x_sane(contxt, SYMBOL, num); } From 9314267ff7b99490c1dade260b6510313a7c2243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 23 May 2020 23:39:17 +0200 Subject: [PATCH 06/20] CppCheck in Travis is old. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a65a240..5d325da2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: jobs: include: - stage: Cppcheck - script: cd src && cppcheck --enable=all --max-ctu-depth=4096 --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . + script: cd src && cppcheck --enable=all --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . - stage: Test script: make -C build smoke || (cat build/err.tmp.* 2> /dev/null && false) - stage: Valgrind From 3b85c5928389f3bddbaf2f188502c9177932e5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 23 May 2020 23:45:59 +0200 Subject: [PATCH 07/20] We know that CppCheck can't find all headers. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d325da2..b0fc3ef0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: jobs: include: - stage: Cppcheck - script: cd src && cppcheck --enable=all --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . + script: cd src && cppcheck --enable=all --suppress=missingInclude --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . - stage: Test script: make -C build smoke || (cat build/err.tmp.* 2> /dev/null && false) - stage: Valgrind From 7e62538d00fc2d5fba8f435c7c054888c4984940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 23 May 2020 23:53:14 +0200 Subject: [PATCH 08/20] Set CppCheck error code. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b0fc3ef0..6274d926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: jobs: include: - stage: Cppcheck - script: cd src && cppcheck --enable=all --suppress=missingInclude --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . + script: cd src && cppcheck --error-exitcode=1 --enable=all --suppress=missingInclude --suppress=unusedFunction --suppress=ConfigurationNotChecked --suppress=knownConditionTrueFalse . - stage: Test script: make -C build smoke || (cat build/err.tmp.* 2> /dev/null && false) - stage: Valgrind From 0b75762fe2b9d12aec277c7af50009740ccf83a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sun, 24 May 2020 01:55:09 +0200 Subject: [PATCH 09/20] Clang scan-build fix. --- src/file.c | 23 ++++++----------------- src/init.c | 4 +++- src/types.h | 1 - test/test.delete | 4 +++- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/file.c b/src/file.c index b06d1f29..cb8607a7 100644 --- a/src/file.c +++ b/src/file.c @@ -2394,7 +2394,7 @@ entry_p n_delete(entry_p contxt) #if defined(AMIGA) && !defined(LG_TEST) int wild = ParsePatternNoCase(file, buf_raw(), buf_len()); #else - int wild = get_num(contxt, "@wild"); + int wild = get_num(contxt, "@alfa"); #endif // 0 == no pattern, 1 == pattern, -1 == buffer overflow. @@ -2571,6 +2571,7 @@ entry_p n_foreach(entry_p contxt) #else cur->type = h_exists(name); cur->name = DBG_ALLOC(strdup(name)); + err = get_num(contxt, "@alfa") == LG_TRUE; #endif // Empty name indicates a PANIC if the locking failed. @@ -2726,16 +2727,11 @@ entry_p n_makeassign(entry_p contxt) } } #else - res = LG_TRUE; + res = get_num(contxt, "@beta"); #endif // Log the outcome. - h_log(contxt, - // Clang scan-build dead code true positive. -#ifndef __clang_analyzer__ - res ? tr(S_ACRT) : -#endif - tr(S_ACRE), asn, dst); + h_log(contxt, res ? tr(S_ACRT) : tr(S_ACRE), asn, dst); } else { @@ -2743,22 +2739,15 @@ entry_p n_makeassign(entry_p contxt) // Remove assign. res = AssignLock(str(C_ARG(1)), (BPTR) NULL) ? LG_TRUE : LG_FALSE; #else - res = LG_FAKE; + res = get_num(contxt, "@gamma"); #endif // Log the outcome. - h_log(contxt, - // Clang scan-build dead code true positive. -#ifndef __clang_analyzer__ - res ? tr(S_ADEL) : -#endif - tr(S_ADLE), asn); + h_log(contxt, res ? tr(S_ADEL) : tr(S_ADLE), asn); } // Clang scan-build dead code true positive. -#ifndef __clang_analyzer__ if(!res) -#endif { // Could not create / rm assign / get lock. ERR(ERR_ASSIGN, str(C_ARG(1))); diff --git a/src/init.c b/src/init.c index 297a787b..663d0824 100644 --- a/src/init.c +++ b/src/init.c @@ -167,12 +167,14 @@ static void init_misc_num(entry_p contxt) init_num(contxt, "@skip", LG_FALSE); init_num(contxt, "@abort", LG_FALSE); init_num(contxt, "@back", LG_FALSE); - init_num(contxt, "@wild", LG_FALSE); init_num(contxt, "@each-type", LG_FALSE); init_num(contxt, "@debug", LG_FALSE); init_num(contxt, "@trap", LG_FALSE); init_num(contxt, "true", LG_TRUE); init_num(contxt, "false", LG_FALSE); + init_num(contxt, "@alfa", 0); + init_num(contxt, "@beta", 1); + init_num(contxt, "@gamma", 2); init_num(contxt, "@strict", // In test mode, strict is default. #if defined(AMIGA) && !defined(LG_TEST) diff --git a/src/types.h b/src/types.h index 85b420fb..a0576969 100644 --- a/src/types.h +++ b/src/types.h @@ -34,7 +34,6 @@ //------------------------------------------------------------------------------ // Default return values. //------------------------------------------------------------------------------ -#define LG_FAKE 2 #define LG_TRUE 1 #define LG_FALSE 0 diff --git a/test/test.delete b/test/test.delete index b3109435..37f0e515 100644 --- a/test/test.delete +++ b/test/test.delete @@ -16,7 +16,9 @@ (delopts "nofail" "force") (textfile (dest "_dl_") (append "a")) (protect "_dl_" "-rwe") (delete "_dl_") ; "rm -Rf _dl_","1","test ! -f _dl_" (set @yes 0) (set @pretend 0) (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" (set @yes 0) (set @pretend "1") (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" -(set @yes 0 @wild -1) (set @pretend "1") (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","Line 1: Buffer overflow '_dl_' 0","test -f _dl_ && rm -f _dl_" +(set @yes 0 @alfa -1) (set @pretend "1") (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","Line 1: Buffer overflow '_dl_' 0","test -f _dl_ && rm -f _dl_" +(set @yes 0) (set @alfa 0) (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" +(set @yes 0) (set @alfa 1) (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","1","test -f _dl_ && rm -Rf _dl_ && test ! -f _dl_" (set @yes 0) (set @pretend "a") (delete "_dl_" (optional askuser force)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" (set @yes 0) (set @pretend 1) (delete "_dl_" (optional askuser force) (safe)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" (set @yes 0) (set @pretend "1") (delete "_dl_" (optional askuser force) (safe)) ; "touch _dl_ && chmod a-w _dl_","1","test ! -f _dl_" From b50ad22edd01362829a6c7910c1da3cacbfa3d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sun, 24 May 2020 02:04:32 +0200 Subject: [PATCH 10/20] Test fix. --- test/test.sys | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test.sys b/test/test.sys index 74fbaf7f..ad266dec 100644 --- a/test/test.sys +++ b/test/test.sys @@ -45,7 +45,10 @@ ("%ld" @skip) ; "","0","" ("%ld" @abort) ; "","0","" ("%ld" @back) ; "","0","" -("%ld" @wild) ; "","0","" +("%ld" @alfa) ; "","0","" +("%ld" @beta) ; "","1","" +("%ld" @gamma) ; "","2","" +("%ld" @mumbojumbo) ; "","Line 1: Undefined variable '@mumbojumbo' 0","" ("%ld" @each-type) ; "","0","" ("%ld" @debug) ; "","0","" ("%ld" @trap) ; "","0","" From e1f1d1a7a15ce247404cc97fc2881b92549e3501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Mon, 1 Jun 2020 22:42:34 +0200 Subject: [PATCH 11/20] AxRT testt. --- build/Makefile.axrt | 4 +- build/axrt.script | 24 ++ build/lexer.c | 840 +++++++++++++++++++++----------------------- src/args.c | 12 +- src/lexer.l | 10 + 5 files changed, 455 insertions(+), 435 deletions(-) diff --git a/build/Makefile.axrt b/build/Makefile.axrt index aefdcdd6..63e3e859 100644 --- a/build/Makefile.axrt +++ b/build/Makefile.axrt @@ -12,7 +12,7 @@ LDFLAGS = -specs=/usr/lib/x86_64-linux-gnu/axrt.specs CGEN = -O0 -std=gnu99 -DAMIGA CINC = -I /usr/include/axrt -I . -I $(VPATH) CDEF = -D_DEFAULT_SOURCE -D_GNU_SOURCE -D__AMIGADATE__="\"($(DATE))\"" $(CEXT) -CFLAGS = $(CINC) $(CGEN) $(CDEF) -D__AROS__ -g -O0 -I/usr/include/axrt +CFLAGS = $(CINC) $(CGEN) $(CDEF) -D__AROS__ -D__AXRT__ -g -O0 -I/usr/include/axrt $(EXE): $(OBJ) parser.o lexer.o $(STARTUP_OBJ) /usr/lib/x86_64-linux-gnu/axrt.ld $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) @@ -21,7 +21,7 @@ parser.o: parser.c $(CC) $(CINC) $(CDEF) $(CGEN) -c $< -DYYERROR_VERBOSE lexer.o: lexer.c - $(CC) $(CINC) $(CDEF) $(CGEN) -c $< + $(CC) $(CINC) $(CDEF) $(CGEN) -D__AXRT__ -c $< parser.c: parser.y $(YACC) $(YFLAGS) -d $< -o $@ diff --git a/build/axrt.script b/build/axrt.script index 9894cdae..d9c9bda9 100644 --- a/build/axrt.script +++ b/build/axrt.script @@ -1 +1,25 @@ +; Using a custom screen doesn't seem to work. Uncomment to test. +;(effect "center_left" 'horizontal' 1 254) (effect "center_left" 'horizontal' 1 255) ; "","e 36:1:254 36:1:255 1","" + +; Silly experiment, smooth progress +(procedure progress start stop delay + ( + (set i start) + (while (<= i stop) + (set i (+ i 1)) + (set j delay) + (while (> j 0) + (set j (- j 1)) + (complete i) + ) + ) + ) +) + +(progress 0 25 2000) (message "Hello AxRT world!") + +(progress 25 75 2000) +(message ("File:%s" (askfile (default "No file") (prompt "Pick a file") (help "Nope, no help")))) + +(progress 75 100 2000) diff --git a/build/lexer.c b/build/lexer.c index 11ddf4c3..e5ed633e 100644 --- a/build/lexer.c +++ b/build/lexer.c @@ -1,5 +1,5 @@ -#line 2 "" +#line 3 "" #define YY_INT_ALIGNED short int @@ -7,24 +7,12 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif -#ifdef yyget_lval -#define yyget_lval_ALREADY_DEFINED -#else -#define yyget_lval yyget_lval -#endif - -#ifdef yyset_lval -#define yyset_lval_ALREADY_DEFINED -#else -#define yyset_lval yyset_lval -#endif - /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -58,6 +46,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -65,6 +54,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -95,32 +85,38 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif +#endif /* ! FLEXINT_H */ -#endif /* ! C99 */ +#ifdef __cplusplus -#endif /* ! FLEXINT_H */ +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST -/* begin standard C++ headers. */ +#else /* ! __cplusplus */ -/* TODO: this is always defined, so inline it */ -#define yyconst const +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) +#ifdef YY_USE_CONST +#define yyconst const #else -#define yynoreturn +#define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -144,29 +140,25 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * + /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START + /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_NEW_FILE yyrestart(yyin ,yyscanner ) + #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -186,9 +178,8 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -203,6 +194,7 @@ typedef size_t yy_size_t; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) + #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -217,12 +209,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -245,7 +237,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -279,77 +271,84 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) + /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void yyrestart ( FILE *input_file , yyscan_t yyscanner ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); -void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -void yypop_buffer_state ( yyscan_t yyscanner ); +void yyrestart (FILE *input_file ,yyscan_t yyscanner ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void yypop_buffer_state (yyscan_t yyscanner ); + +static void yyensure_buffer_stack (yyscan_t yyscanner ); +static void yy_load_buffer_state (yyscan_t yyscanner ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); -static void yyensure_buffer_stack ( yyscan_t yyscanner ); -static void yy_load_buffer_state ( yyscan_t yyscanner ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); -void *yyalloc ( yy_size_t , yyscan_t yyscanner ); -void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); -void yyfree ( void * , yyscan_t yyscanner ); +void *yyalloc (yy_size_t ,yyscan_t yyscanner ); +void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); +void yyfree (void * ,yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(yyscanner) (/*CONSTCOND*/1) +#define yywrap(n) 1 #define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; + +typedef unsigned char YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); -static int yy_get_next_buffer ( yyscan_t yyscanner ); -static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); +static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static int yy_get_next_buffer (yyscan_t yyscanner ); +static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; + #define YY_NUM_RULES 155 #define YY_END_OF_BUFFER 156 /* This struct is not used in this scanner, @@ -359,7 +358,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[717] = +static yyconst flex_int16_t yy_accept[717] = { 0, 0, 0, 0, 0, 156, 145, 149, 147, 148, 155, 145, 145, 155, 4, 5, 14, 12, 13, 15, 1, @@ -442,7 +441,7 @@ static const flex_int16_t yy_accept[717] = 97, 145, 145, 112, 132, 0 } ; -static const YY_CHAR yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -474,7 +473,7 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[76] = +static yyconst flex_int32_t yy_meta[76] = { 0, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, @@ -486,7 +485,7 @@ static const YY_CHAR yy_meta[76] = 1, 1, 1, 1, 1 } ; -static const flex_int16_t yy_base[723] = +static yyconst flex_int16_t yy_base[723] = { 0, 0, 0, 73, 75, 205, 0, 172, 1464, 154, 75, 108, 139, 73, 1464, 1464, 1464, 1464, 66, 1464, 70, @@ -570,7 +569,7 @@ static const flex_int16_t yy_base[723] = 1459, 1461 } ; -static const flex_int16_t yy_def[723] = +static yyconst flex_int16_t yy_def[723] = { 0, 716, 1, 717, 717, 716, 718, 716, 716, 716, 719, 718, 718, 720, 716, 716, 716, 716, 718, 716, 718, @@ -654,7 +653,7 @@ static const flex_int16_t yy_def[723] = 716, 716 } ; -static const flex_int16_t yy_nxt[1540] = +static yyconst flex_int16_t yy_nxt[1540] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 6, 19, 20, 20, 21, 22, 23, @@ -827,7 +826,7 @@ static const flex_int16_t yy_nxt[1540] = 716, 716, 716, 716, 716, 716, 716, 716, 716 } ; -static const flex_int16_t yy_chk[1540] = +static yyconst flex_int16_t yy_chk[1540] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1033,13 +1032,11 @@ static FILE *script; /* strduptr(const char *str) - Duplicate string and translate escape characters according to the Installer V42.6 guide */ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ static char *strduptr(const char *str); -#line 1036 "" -#line 28 "../src/lexer.l" - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - /* We need the parser to be reentrant, not because we want to, but because it will will leak memory otherwise. */ - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* We need the parser to be reentrant, not because we want to, but because it will will leak memory otherwise. */ +/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#line 1042 "" +#line 1040 "" #define INITIAL 0 #define comment 1 @@ -1069,8 +1066,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -1092,7 +1089,7 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals ( yyscan_t yyscanner ); +static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ @@ -1100,44 +1097,40 @@ static int yy_init_globals ( yyscan_t yyscanner ); int yylex_init (yyscan_t* scanner); -int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); +int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy ( yyscan_t yyscanner ); - -int yyget_debug ( yyscan_t yyscanner ); +int yylex_destroy (yyscan_t yyscanner ); -void yyset_debug ( int debug_flag , yyscan_t yyscanner ); +int yyget_debug (yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); +void yyset_debug (int debug_flag ,yyscan_t yyscanner ); -void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); -FILE *yyget_in ( yyscan_t yyscanner ); +void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); -void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); +FILE *yyget_in (yyscan_t yyscanner ); -FILE *yyget_out ( yyscan_t yyscanner ); +void yyset_in (FILE * in_str ,yyscan_t yyscanner ); -void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); +FILE *yyget_out (yyscan_t yyscanner ); - int yyget_leng ( yyscan_t yyscanner ); +void yyset_out (FILE * out_str ,yyscan_t yyscanner ); -char *yyget_text ( yyscan_t yyscanner ); +yy_size_t yyget_leng (yyscan_t yyscanner ); -int yyget_lineno ( yyscan_t yyscanner ); +char *yyget_text (yyscan_t yyscanner ); -void yyset_lineno ( int _line_number , yyscan_t yyscanner ); +int yyget_lineno (yyscan_t yyscanner ); -int yyget_column ( yyscan_t yyscanner ); +void yyset_lineno (int line_number ,yyscan_t yyscanner ); -void yyset_column ( int _column_no , yyscan_t yyscanner ); +YYSTYPE * yyget_lval (yyscan_t yyscanner ); -YYSTYPE * yyget_lval ( yyscan_t yyscanner ); - -void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); +void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1145,43 +1138,35 @@ void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap ( yyscan_t yyscanner ); +extern "C" int yywrap (yyscan_t yyscanner ); #else -extern int yywrap ( yyscan_t yyscanner ); +extern int yywrap (yyscan_t yyscanner ); #endif #endif -#ifndef YY_NO_UNPUT - - static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); + static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); -#endif - #ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput ( yyscan_t yyscanner ); +static int yyinput (yyscan_t yyscanner ); #else -static int input ( yyscan_t yyscanner ); +static int input (yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1189,7 +1174,7 @@ static int input ( yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1200,7 +1185,7 @@ static int input ( yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1213,7 +1198,7 @@ static int input ( yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1255,7 +1240,7 @@ static int input ( yyscan_t yyscanner ); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner); + (YYSTYPE * yylval_param ,yyscan_t yyscanner); #define YY_DECL int yylex \ (YYSTYPE * yylval_param , yyscan_t yyscanner) @@ -1270,7 +1255,7 @@ extern int yylex \ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif #define YY_RULE_SETUP \ @@ -1280,11 +1265,18 @@ extern int yylex \ */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; +#line 33 "../src/lexer.l" + + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + /* Decimal numbers */ + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#line 1279 "" + yylval = yylval_param; if ( !yyg->yy_init ) @@ -1307,21 +1299,13 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - yy_load_buffer_state( yyscanner ); + yy_load_buffer_state(yyscanner ); } - { -#line 34 "../src/lexer.l" - - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - /* Decimal numbers */ - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#line 1322 "" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -1337,7 +1321,7 @@ YY_DECL yy_match: do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1347,9 +1331,9 @@ YY_DECL { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1464 ); @@ -1378,7 +1362,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 38 "../src/lexer.l" +#line 37 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext, NULL, 10); return INT; @@ -1389,7 +1373,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 2: YY_RULE_SETUP -#line 46 "../src/lexer.l" +#line 45 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext + 1, NULL, 16); return HEX; @@ -1400,7 +1384,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 3: YY_RULE_SETUP -#line 54 "../src/lexer.l" +#line 53 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext + 1, NULL, 2); return BIN; @@ -1411,12 +1395,12 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 4: YY_RULE_SETUP -#line 62 "../src/lexer.l" +#line 61 "../src/lexer.l" { return '('; } YY_BREAK case 5: YY_RULE_SETUP -#line 63 "../src/lexer.l" +#line 62 "../src/lexer.l" { return ')'; } YY_BREAK /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -1424,687 +1408,687 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 6: YY_RULE_SETUP -#line 68 "../src/lexer.l" +#line 67 "../src/lexer.l" { return '='; } YY_BREAK case 7: YY_RULE_SETUP -#line 69 "../src/lexer.l" +#line 68 "../src/lexer.l" { return '<'; } YY_BREAK case 8: YY_RULE_SETUP -#line 70 "../src/lexer.l" +#line 69 "../src/lexer.l" { return LTE; } YY_BREAK case 9: YY_RULE_SETUP -#line 71 "../src/lexer.l" +#line 70 "../src/lexer.l" { return '>'; } YY_BREAK case 10: YY_RULE_SETUP -#line 72 "../src/lexer.l" +#line 71 "../src/lexer.l" { return GTE; } YY_BREAK case 11: YY_RULE_SETUP -#line 73 "../src/lexer.l" +#line 72 "../src/lexer.l" { return NEQ; } YY_BREAK case 12: YY_RULE_SETUP -#line 74 "../src/lexer.l" +#line 73 "../src/lexer.l" { return '+'; } YY_BREAK case 13: YY_RULE_SETUP -#line 75 "../src/lexer.l" +#line 74 "../src/lexer.l" { return '-'; } YY_BREAK case 14: YY_RULE_SETUP -#line 76 "../src/lexer.l" +#line 75 "../src/lexer.l" { return '*'; } YY_BREAK case 15: YY_RULE_SETUP -#line 77 "../src/lexer.l" +#line 76 "../src/lexer.l" { return '/'; } YY_BREAK case 16: YY_RULE_SETUP -#line 78 "../src/lexer.l" +#line 77 "../src/lexer.l" { return AND; } YY_BREAK case 17: YY_RULE_SETUP -#line 79 "../src/lexer.l" +#line 78 "../src/lexer.l" { return OR; } YY_BREAK case 18: YY_RULE_SETUP -#line 80 "../src/lexer.l" +#line 79 "../src/lexer.l" { return XOR; } YY_BREAK case 19: YY_RULE_SETUP -#line 81 "../src/lexer.l" +#line 80 "../src/lexer.l" { return NOT; } YY_BREAK case 20: YY_RULE_SETUP -#line 82 "../src/lexer.l" +#line 81 "../src/lexer.l" { return BITAND; } YY_BREAK case 21: YY_RULE_SETUP -#line 83 "../src/lexer.l" +#line 82 "../src/lexer.l" { return BITOR; } YY_BREAK case 22: YY_RULE_SETUP -#line 84 "../src/lexer.l" +#line 83 "../src/lexer.l" { return BITXOR; } YY_BREAK case 23: YY_RULE_SETUP -#line 85 "../src/lexer.l" +#line 84 "../src/lexer.l" { return BITNOT; } YY_BREAK case 24: YY_RULE_SETUP -#line 86 "../src/lexer.l" +#line 85 "../src/lexer.l" { return SHIFTLEFT; } YY_BREAK case 25: YY_RULE_SETUP -#line 87 "../src/lexer.l" +#line 86 "../src/lexer.l" { return SHIFTRIGHT; } YY_BREAK case 26: YY_RULE_SETUP -#line 88 "../src/lexer.l" +#line 87 "../src/lexer.l" { return IN; } YY_BREAK case 27: YY_RULE_SETUP -#line 89 "../src/lexer.l" +#line 88 "../src/lexer.l" { return SET; } YY_BREAK case 28: YY_RULE_SETUP -#line 90 "../src/lexer.l" +#line 89 "../src/lexer.l" { return DCL; } YY_BREAK case 29: YY_RULE_SETUP -#line 91 "../src/lexer.l" +#line 90 "../src/lexer.l" { return IF; } YY_BREAK case 30: YY_RULE_SETUP -#line 92 "../src/lexer.l" +#line 91 "../src/lexer.l" { return WHILE; } YY_BREAK case 31: YY_RULE_SETUP -#line 93 "../src/lexer.l" +#line 92 "../src/lexer.l" { return UNTIL; } YY_BREAK case 32: YY_RULE_SETUP -#line 94 "../src/lexer.l" +#line 93 "../src/lexer.l" { return TRACE; } YY_BREAK case 33: YY_RULE_SETUP -#line 95 "../src/lexer.l" +#line 94 "../src/lexer.l" { return RETRACE; } YY_BREAK case 34: YY_RULE_SETUP -#line 96 "../src/lexer.l" +#line 95 "../src/lexer.l" { return STRLEN; } YY_BREAK case 35: YY_RULE_SETUP -#line 97 "../src/lexer.l" +#line 96 "../src/lexer.l" { return SUBSTR; } YY_BREAK case 36: YY_RULE_SETUP -#line 98 "../src/lexer.l" +#line 97 "../src/lexer.l" { return ASKDIR; } YY_BREAK case 37: YY_RULE_SETUP -#line 99 "../src/lexer.l" +#line 98 "../src/lexer.l" { return ASKFILE; } YY_BREAK case 38: YY_RULE_SETUP -#line 100 "../src/lexer.l" +#line 99 "../src/lexer.l" { return ASKSTRING; } YY_BREAK case 39: YY_RULE_SETUP -#line 101 "../src/lexer.l" +#line 100 "../src/lexer.l" { return ASKNUMBER; } YY_BREAK case 40: YY_RULE_SETUP -#line 102 "../src/lexer.l" +#line 101 "../src/lexer.l" { return ASKCHOICE; } YY_BREAK case 41: YY_RULE_SETUP -#line 103 "../src/lexer.l" +#line 102 "../src/lexer.l" { return ASKOPTIONS; } YY_BREAK case 42: YY_RULE_SETUP -#line 104 "../src/lexer.l" +#line 103 "../src/lexer.l" { return ASKBOOL; } YY_BREAK case 43: YY_RULE_SETUP -#line 105 "../src/lexer.l" +#line 104 "../src/lexer.l" { return ASKDISK; } YY_BREAK case 44: YY_RULE_SETUP -#line 106 "../src/lexer.l" +#line 105 "../src/lexer.l" { return CAT; } YY_BREAK case 45: YY_RULE_SETUP -#line 107 "../src/lexer.l" +#line 106 "../src/lexer.l" { return EXISTS; } YY_BREAK case 46: YY_RULE_SETUP -#line 108 "../src/lexer.l" +#line 107 "../src/lexer.l" { return EXPANDPATH; } YY_BREAK case 47: YY_RULE_SETUP -#line 109 "../src/lexer.l" +#line 108 "../src/lexer.l" { return EARLIER; } YY_BREAK case 48: YY_RULE_SETUP -#line 110 "../src/lexer.l" +#line 109 "../src/lexer.l" { return FILEONLY; } YY_BREAK case 49: YY_RULE_SETUP -#line 111 "../src/lexer.l" +#line 110 "../src/lexer.l" { return GETASSIGN; } YY_BREAK case 50: YY_RULE_SETUP -#line 112 "../src/lexer.l" +#line 111 "../src/lexer.l" { return GETDEVICE; } YY_BREAK case 51: YY_RULE_SETUP -#line 113 "../src/lexer.l" +#line 112 "../src/lexer.l" { return GETDISKSPACE; } YY_BREAK case 52: YY_RULE_SETUP -#line 114 "../src/lexer.l" +#line 113 "../src/lexer.l" { return GETENV; } YY_BREAK case 53: YY_RULE_SETUP -#line 115 "../src/lexer.l" +#line 114 "../src/lexer.l" { return GETSIZE; } YY_BREAK case 54: YY_RULE_SETUP -#line 116 "../src/lexer.l" +#line 115 "../src/lexer.l" { return GETSUM; } YY_BREAK case 55: YY_RULE_SETUP -#line 117 "../src/lexer.l" +#line 116 "../src/lexer.l" { return GETVERSION; } YY_BREAK case 56: YY_RULE_SETUP -#line 118 "../src/lexer.l" +#line 117 "../src/lexer.l" { return ICONINFO; } YY_BREAK case 57: YY_RULE_SETUP -#line 119 "../src/lexer.l" +#line 118 "../src/lexer.l" { return QUERYDISPLAY; } YY_BREAK case 58: YY_RULE_SETUP -#line 120 "../src/lexer.l" +#line 119 "../src/lexer.l" { return PATHONLY; } YY_BREAK case 59: YY_RULE_SETUP -#line 121 "../src/lexer.l" +#line 120 "../src/lexer.l" { return PATMATCH; } YY_BREAK case 60: YY_RULE_SETUP -#line 122 "../src/lexer.l" +#line 121 "../src/lexer.l" { return SELECT; } YY_BREAK case 61: YY_RULE_SETUP -#line 123 "../src/lexer.l" +#line 122 "../src/lexer.l" { return SYMBOLSET; } YY_BREAK case 62: YY_RULE_SETUP -#line 124 "../src/lexer.l" +#line 123 "../src/lexer.l" { return SYMBOLVAL; } YY_BREAK case 63: YY_RULE_SETUP -#line 125 "../src/lexer.l" +#line 124 "../src/lexer.l" { return TACKON; } YY_BREAK case 64: YY_RULE_SETUP -#line 126 "../src/lexer.l" +#line 125 "../src/lexer.l" { return TRANSCRIPT; } YY_BREAK case 65: YY_RULE_SETUP -#line 127 "../src/lexer.l" +#line 126 "../src/lexer.l" { return COMPLETE; } YY_BREAK case 66: YY_RULE_SETUP -#line 128 "../src/lexer.l" +#line 127 "../src/lexer.l" { return CLOSEMEDIA; } YY_BREAK case 67: YY_RULE_SETUP -#line 129 "../src/lexer.l" +#line 128 "../src/lexer.l" { return EFFECT; } YY_BREAK case 68: YY_RULE_SETUP -#line 130 "../src/lexer.l" +#line 129 "../src/lexer.l" { return SETMEDIA; } YY_BREAK case 69: YY_RULE_SETUP -#line 131 "../src/lexer.l" +#line 130 "../src/lexer.l" { return SHOWMEDIA; } YY_BREAK case 70: YY_RULE_SETUP -#line 132 "../src/lexer.l" +#line 131 "../src/lexer.l" { return USER; } YY_BREAK case 71: YY_RULE_SETUP -#line 133 "../src/lexer.l" +#line 132 "../src/lexer.l" { return WORKING; } YY_BREAK case 72: YY_RULE_SETUP -#line 134 "../src/lexer.l" +#line 133 "../src/lexer.l" { return WELCOME; } YY_BREAK case 73: YY_RULE_SETUP -#line 135 "../src/lexer.l" +#line 134 "../src/lexer.l" { return ABORT; } YY_BREAK case 74: YY_RULE_SETUP -#line 136 "../src/lexer.l" +#line 135 "../src/lexer.l" { return COPYFILES; } YY_BREAK case 75: YY_RULE_SETUP -#line 137 "../src/lexer.l" +#line 136 "../src/lexer.l" { return COPYLIB; } YY_BREAK case 76: YY_RULE_SETUP -#line 138 "../src/lexer.l" +#line 137 "../src/lexer.l" { return DATABASE; } YY_BREAK case 77: YY_RULE_SETUP -#line 139 "../src/lexer.l" +#line 138 "../src/lexer.l" { return DEBUG; } YY_BREAK case 78: YY_RULE_SETUP -#line 140 "../src/lexer.l" +#line 139 "../src/lexer.l" { return DELETE; } YY_BREAK case 79: YY_RULE_SETUP -#line 141 "../src/lexer.l" +#line 140 "../src/lexer.l" { return EXECUTE; } YY_BREAK case 80: YY_RULE_SETUP -#line 142 "../src/lexer.l" +#line 141 "../src/lexer.l" { return EXIT; } YY_BREAK case 81: YY_RULE_SETUP -#line 143 "../src/lexer.l" +#line 142 "../src/lexer.l" { return FOREACH; } YY_BREAK case 82: YY_RULE_SETUP -#line 144 "../src/lexer.l" +#line 143 "../src/lexer.l" { return MAKEASSIGN; } YY_BREAK case 83: YY_RULE_SETUP -#line 145 "../src/lexer.l" +#line 144 "../src/lexer.l" { return MAKEDIR; } YY_BREAK case 84: YY_RULE_SETUP -#line 146 "../src/lexer.l" +#line 145 "../src/lexer.l" { return MESSAGE; } YY_BREAK case 85: YY_RULE_SETUP -#line 147 "../src/lexer.l" +#line 146 "../src/lexer.l" { return ONERROR; } YY_BREAK case 86: YY_RULE_SETUP -#line 148 "../src/lexer.l" +#line 147 "../src/lexer.l" { return PROTECT; } YY_BREAK case 87: YY_RULE_SETUP -#line 149 "../src/lexer.l" +#line 148 "../src/lexer.l" { return RENAME; } YY_BREAK case 88: YY_RULE_SETUP -#line 150 "../src/lexer.l" +#line 149 "../src/lexer.l" { return REXX; } YY_BREAK case 89: YY_RULE_SETUP -#line 151 "../src/lexer.l" +#line 150 "../src/lexer.l" { return RUN; } YY_BREAK case 90: YY_RULE_SETUP -#line 152 "../src/lexer.l" +#line 151 "../src/lexer.l" { return STARTUP; } YY_BREAK case 91: YY_RULE_SETUP -#line 153 "../src/lexer.l" +#line 152 "../src/lexer.l" { return TEXTFILE; } YY_BREAK case 92: YY_RULE_SETUP -#line 154 "../src/lexer.l" +#line 153 "../src/lexer.l" { return TOOLTYPE; } YY_BREAK case 93: YY_RULE_SETUP -#line 155 "../src/lexer.l" +#line 154 "../src/lexer.l" { return TRAP; } YY_BREAK case 94: YY_RULE_SETUP -#line 156 "../src/lexer.l" +#line 155 "../src/lexer.l" { return REBOOT; } YY_BREAK case 95: YY_RULE_SETUP -#line 157 "../src/lexer.l" +#line 156 "../src/lexer.l" { return OPENWBOBJECT; } YY_BREAK case 96: YY_RULE_SETUP -#line 158 "../src/lexer.l" +#line 157 "../src/lexer.l" { return SHOWWBOBJECT; } YY_BREAK case 97: YY_RULE_SETUP -#line 159 "../src/lexer.l" +#line 158 "../src/lexer.l" { return CLOSEWBOBJECT; } YY_BREAK case 98: YY_RULE_SETUP -#line 160 "../src/lexer.l" +#line 159 "../src/lexer.l" { return ALL; } YY_BREAK case 99: YY_RULE_SETUP -#line 161 "../src/lexer.l" +#line 160 "../src/lexer.l" { return APPEND; } YY_BREAK case 100: YY_RULE_SETUP -#line 162 "../src/lexer.l" +#line 161 "../src/lexer.l" { return ASSIGNS; } YY_BREAK case 101: YY_RULE_SETUP -#line 163 "../src/lexer.l" +#line 162 "../src/lexer.l" { return BACK; } YY_BREAK case 102: YY_RULE_SETUP -#line 164 "../src/lexer.l" +#line 163 "../src/lexer.l" { return CHOICES; } YY_BREAK case 103: YY_RULE_SETUP -#line 165 "../src/lexer.l" +#line 164 "../src/lexer.l" { return COMMAND; } YY_BREAK case 104: YY_RULE_SETUP -#line 166 "../src/lexer.l" +#line 165 "../src/lexer.l" { return COMPRESSION; } YY_BREAK case 105: YY_RULE_SETUP -#line 167 "../src/lexer.l" +#line 166 "../src/lexer.l" { return CONFIRM; } YY_BREAK case 106: YY_RULE_SETUP -#line 168 "../src/lexer.l" +#line 167 "../src/lexer.l" { return DEFAULT; } YY_BREAK case 107: YY_RULE_SETUP -#line 169 "../src/lexer.l" +#line 168 "../src/lexer.l" { return DELOPTS; } YY_BREAK case 108: YY_RULE_SETUP -#line 170 "../src/lexer.l" +#line 169 "../src/lexer.l" { return DEST; } YY_BREAK case 109: YY_RULE_SETUP -#line 171 "../src/lexer.l" +#line 170 "../src/lexer.l" { return DISK; } YY_BREAK case 110: YY_RULE_SETUP -#line 172 "../src/lexer.l" +#line 171 "../src/lexer.l" { return FILES; } YY_BREAK case 111: YY_RULE_SETUP -#line 173 "../src/lexer.l" +#line 172 "../src/lexer.l" { return FONTS; } YY_BREAK case 112: YY_RULE_SETUP -#line 174 "../src/lexer.l" +#line 173 "../src/lexer.l" { return GETDEFAULTTOOL; } YY_BREAK case 113: YY_RULE_SETUP -#line 175 "../src/lexer.l" +#line 174 "../src/lexer.l" { return GETPOSITION; } YY_BREAK case 114: YY_RULE_SETUP -#line 176 "../src/lexer.l" +#line 175 "../src/lexer.l" { return GETSTACK; } YY_BREAK case 115: YY_RULE_SETUP -#line 177 "../src/lexer.l" +#line 176 "../src/lexer.l" { return GETTOOLTYPE; } YY_BREAK case 116: YY_RULE_SETUP -#line 178 "../src/lexer.l" +#line 177 "../src/lexer.l" { return HELP; } YY_BREAK case 117: YY_RULE_SETUP -#line 179 "../src/lexer.l" +#line 178 "../src/lexer.l" { return INFOS; } YY_BREAK case 118: YY_RULE_SETUP -#line 180 "../src/lexer.l" +#line 179 "../src/lexer.l" { return INCLUDE; } YY_BREAK case 119: YY_RULE_SETUP -#line 181 "../src/lexer.l" +#line 180 "../src/lexer.l" { return NEWNAME; } YY_BREAK case 120: YY_RULE_SETUP -#line 182 "../src/lexer.l" +#line 181 "../src/lexer.l" { return NEWPATH; } YY_BREAK case 121: YY_RULE_SETUP -#line 183 "../src/lexer.l" +#line 182 "../src/lexer.l" { return NOGAUGE; } YY_BREAK case 122: YY_RULE_SETUP -#line 184 "../src/lexer.l" +#line 183 "../src/lexer.l" { return NOPOSITION; } YY_BREAK case 123: YY_RULE_SETUP -#line 185 "../src/lexer.l" +#line 184 "../src/lexer.l" { return NOREQ; } YY_BREAK case 124: YY_RULE_SETUP -#line 186 "../src/lexer.l" +#line 185 "../src/lexer.l" { return OPTIONAL; } YY_BREAK case 125: YY_RULE_SETUP -#line 187 "../src/lexer.l" +#line 186 "../src/lexer.l" { return OVERRIDE; } YY_BREAK case 126: YY_RULE_SETUP -#line 188 "../src/lexer.l" +#line 187 "../src/lexer.l" { return PATTERN; } YY_BREAK case 127: YY_RULE_SETUP -#line 189 "../src/lexer.l" +#line 188 "../src/lexer.l" { return PROMPT; } YY_BREAK case 128: YY_RULE_SETUP -#line 190 "../src/lexer.l" +#line 189 "../src/lexer.l" { return QUIET; } YY_BREAK case 129: YY_RULE_SETUP -#line 191 "../src/lexer.l" +#line 190 "../src/lexer.l" { return RANGE; } YY_BREAK case 130: YY_RULE_SETUP -#line 192 "../src/lexer.l" +#line 191 "../src/lexer.l" { return RESIDENT; } YY_BREAK case 131: YY_RULE_SETUP -#line 193 "../src/lexer.l" +#line 192 "../src/lexer.l" { return SAFE; } YY_BREAK case 132: YY_RULE_SETUP -#line 194 "../src/lexer.l" +#line 193 "../src/lexer.l" { return SETDEFAULTTOOL; } YY_BREAK case 133: YY_RULE_SETUP -#line 195 "../src/lexer.l" +#line 194 "../src/lexer.l" { return SETSTACK; } YY_BREAK case 134: YY_RULE_SETUP -#line 196 "../src/lexer.l" +#line 195 "../src/lexer.l" { return SETTOOLTYPE; } YY_BREAK case 135: YY_RULE_SETUP -#line 197 "../src/lexer.l" +#line 196 "../src/lexer.l" { return SETPOSITION; } YY_BREAK case 136: YY_RULE_SETUP -#line 198 "../src/lexer.l" +#line 197 "../src/lexer.l" { return SOURCE; } YY_BREAK case 137: YY_RULE_SETUP -#line 199 "../src/lexer.l" +#line 198 "../src/lexer.l" { return SWAPCOLORS; } YY_BREAK case 138: YY_RULE_SETUP -#line 200 "../src/lexer.l" +#line 199 "../src/lexer.l" { return ASTRAW; } YY_BREAK case 139: YY_RULE_SETUP -#line 201 "../src/lexer.l" +#line 200 "../src/lexer.l" { return ASBRAW; } YY_BREAK case 140: YY_RULE_SETUP -#line 202 "../src/lexer.l" +#line 201 "../src/lexer.l" { return ASBEVAL; } YY_BREAK case 141: YY_RULE_SETUP -#line 203 "../src/lexer.l" +#line 202 "../src/lexer.l" { return EVAL; } YY_BREAK case 142: YY_RULE_SETUP -#line 204 "../src/lexer.l" +#line 203 "../src/lexer.l" { return OPTIONS; } YY_BREAK /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -2112,11 +2096,11 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 143: /* rule 143 can match eol */ -#line 210 "../src/lexer.l" +#line 209 "../src/lexer.l" case 144: /* rule 144 can match eol */ YY_RULE_SETUP -#line 210 "../src/lexer.l" +#line 209 "../src/lexer.l" { yylval->s = strduptr(yytext); return yylval->s ? STR : OOM; @@ -2127,7 +2111,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 145: YY_RULE_SETUP -#line 218 "../src/lexer.l" +#line 217 "../src/lexer.l" { yylval->s = strdup(yytext); return yylval->s ? SYM : OOM; @@ -2139,63 +2123,63 @@ YY_RULE_SETUP case 146: /* rule 146 can match eol */ YY_RULE_SETUP -#line 226 "../src/lexer.l" +#line 225 "../src/lexer.l" { yylineno++; } YY_BREAK case 147: /* rule 147 can match eol */ YY_RULE_SETUP -#line 227 "../src/lexer.l" +#line 226 "../src/lexer.l" { yylineno++; } YY_BREAK case 148: YY_RULE_SETUP -#line 228 "../src/lexer.l" +#line 227 "../src/lexer.l" { yylineno++; } YY_BREAK case 149: YY_RULE_SETUP -#line 229 "../src/lexer.l" +#line 228 "../src/lexer.l" { } YY_BREAK case 150: YY_RULE_SETUP -#line 230 "../src/lexer.l" +#line 229 "../src/lexer.l" { BEGIN(comment); } YY_BREAK case 151: /* rule 151 can match eol */ YY_RULE_SETUP -#line 231 "../src/lexer.l" +#line 230 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 152: /* rule 152 can match eol */ YY_RULE_SETUP -#line 232 "../src/lexer.l" +#line 231 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 153: YY_RULE_SETUP -#line 233 "../src/lexer.l" +#line 232 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 154: YY_RULE_SETUP -#line 234 "../src/lexer.l" +#line 233 "../src/lexer.l" { } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): -#line 235 "../src/lexer.l" +#line 234 "../src/lexer.l" { fclose(script); script = NULL; yyterminate(); } YY_BREAK case 155: YY_RULE_SETUP -#line 236 "../src/lexer.l" +#line 235 "../src/lexer.l" ECHO; YY_BREAK -#line 2198 "" +#line 2183 "" case YY_END_OF_BUFFER: { @@ -2271,7 +2255,7 @@ ECHO; { yyg->yy_did_buffer_switch_on_eof = 0; - if ( yywrap( yyscanner ) ) + if ( yywrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2324,7 +2308,6 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2337,9 +2320,9 @@ ECHO; static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = yyg->yytext_ptr; - int number_to_move, i; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = yyg->yytext_ptr; + register int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -2368,7 +2351,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2381,21 +2364,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2404,12 +2387,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2437,7 +2419,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin , yyscanner); + yyrestart(yyin ,yyscanner); } else @@ -2451,15 +2433,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -2475,15 +2454,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - yy_state_type yy_current_state; - char *yy_cp; + register yy_state_type yy_current_state; + register char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -2493,9 +2472,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; @@ -2508,11 +2487,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - int yy_is_jam; + register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - char *yy_cp = yyg->yy_c_buf_p; + register char *yy_cp = yyg->yy_c_buf_p; - YY_CHAR yy_c = 1; + register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -2522,20 +2501,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 716); - (void)yyg; return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - - static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) + static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) { - char *yy_cp; + register char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_cp = yyg->yy_c_buf_p; @@ -2546,10 +2522,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - int number_to_move = yyg->yy_n_chars + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + register yy_size_t number_to_move = yyg->yy_n_chars + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = + register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2558,7 +2534,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2571,8 +2547,6 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = yy_cp; } -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -2598,7 +2572,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2615,13 +2589,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - yyrestart( yyin , yyscanner); + yyrestart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( yyscanner ) ) + if ( yywrap(yyscanner ) ) return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) @@ -2660,11 +2634,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); - yy_load_buffer_state( yyscanner ); + yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + yy_load_buffer_state(yyscanner ); } /** Switch to a different input buffer. @@ -2693,7 +2667,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( yyscanner ); + yy_load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2722,7 +2696,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2731,13 +2705,13 @@ static void yy_load_buffer_state (yyscan_t yyscanner) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file , yyscanner); + yy_init_buffer(b,file ,yyscanner); return b; } @@ -2757,11 +2731,15 @@ static void yy_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf , yyscanner ); + yyfree((void *) b->yy_ch_buf ,yyscanner ); - yyfree( (void *) b , yyscanner ); + yyfree((void *) b ,yyscanner ); } +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -2772,7 +2750,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flush_buffer( b , yyscanner); + yy_flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2816,7 +2794,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( yyscanner ); + yy_load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -2848,7 +2826,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( yyscanner ); + yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -2862,13 +2840,13 @@ void yypop_buffer_state (yyscan_t yyscanner) if (!YY_CURRENT_BUFFER) return; - yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( yyscanner ); + yy_load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -2887,15 +2865,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + num_to_alloc = 1; yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -2904,7 +2882,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; + int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc @@ -2924,7 +2902,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { @@ -2934,23 +2912,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return NULL; + return 0; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; + b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b , yyscanner ); + yy_switch_to_buffer(b ,yyscanner ); return b; } @@ -2963,29 +2941,28 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) { - return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); + return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n , yyscanner ); + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2994,7 +2971,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n , yyscanner); + b = yy_scan_buffer(buf,n ,yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -3010,11 +2987,9 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3052,7 +3027,7 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3065,7 +3040,7 @@ int yyget_lineno (yyscan_t yyscanner) int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3093,7 +3068,7 @@ FILE *yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int yyget_leng (yyscan_t yyscanner) +yy_size_t yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3120,51 +3095,51 @@ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) } /** Set the current line number. - * @param _line_number line number + * @param line_number * @param yyscanner The scanner object. */ -void yyset_lineno (int _line_number , yyscan_t yyscanner) +void yyset_lineno (int line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); - yylineno = _line_number; + yylineno = line_number; } /** Set the current column. - * @param _column_no column number + * @param line_number * @param yyscanner The scanner object. */ -void yyset_column (int _column_no , yyscan_t yyscanner) +void yyset_column (int column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_column called with no buffer" ); + yy_fatal_error( "yyset_column called with no buffer" , yyscanner); - yycolumn = _column_no; + yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param _in_str A readable stream. + * @param in_str A readable stream. * @param yyscanner The scanner object. * @see yy_switch_to_buffer */ -void yyset_in (FILE * _in_str , yyscan_t yyscanner) +void yyset_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = _in_str ; + yyin = in_str ; } -void yyset_out (FILE * _out_str , yyscan_t yyscanner) +void yyset_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = _out_str ; + yyout = out_str ; } int yyget_debug (yyscan_t yyscanner) @@ -3173,10 +3148,10 @@ int yyget_debug (yyscan_t yyscanner) return yy_flex_debug; } -void yyset_debug (int _bdebug , yyscan_t yyscanner) +void yyset_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = _bdebug ; + yy_flex_debug = bdebug ; } /* Accessor methods for yylval and yylloc */ @@ -3199,7 +3174,9 @@ void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ + int yylex_init(yyscan_t* ptr_yy_globals) + { if (ptr_yy_globals == NULL){ errno = EINVAL; @@ -3226,7 +3203,9 @@ int yylex_init(yyscan_t* ptr_yy_globals) * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ -int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) + +int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + { struct yyguts_t dummy_yyguts; @@ -3236,20 +3215,20 @@ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } @@ -3260,10 +3239,10 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = NULL; + yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; @@ -3276,8 +3255,8 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = NULL; - yyout = NULL; + yyin = (FILE *) 0; + yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by @@ -3293,17 +3272,17 @@ int yylex_destroy (yyscan_t yyscanner) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack , yyscanner); + yyfree(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree( yyg->yy_start_stack , yyscanner ); + yyfree(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time @@ -3321,21 +3300,18 @@ int yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - - int i; + register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { - int n; + register int n; for ( n = 0; s[n]; ++n ) ; @@ -3345,16 +3321,11 @@ static int yy_flex_strlen (const char * s , yyscan_t yyscanner) void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - return malloc(size); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; - /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3362,19 +3333,18 @@ void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return realloc(ptr, size); + return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - (void)yyg; free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 236 "../src/lexer.l" +#line 235 "../src/lexer.l" + /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -3412,8 +3382,18 @@ int main(int argc, char **argv) // Assume failure. int ret = -1; +#ifdef __AXRT__ + (void) argc; + (void) argv; + + // Temp AxRT workaround until argument handling in AxRT is implemented. + char *argv_[] = {"Installer", "axrt.script", NULL}; + + if(arg_init(2, argv_)) +#else // Initialize the argument handling. if(arg_init(argc, argv)) +#endif { yyscan_t lexer; @@ -3430,7 +3410,7 @@ int main(int argc, char **argv) if(script) { // Set input file and parse. - yyset_in(script, lexer); + yyset_in(script,lexer); // 1 on syntax error, 0 on success. ret = yyparse(lexer); diff --git a/src/args.c b/src/args.c index 2e8a7dbf..d1f8bec1 100644 --- a/src/args.c +++ b/src/args.c @@ -90,7 +90,8 @@ static bool arg_post(void) //------------------------------------------------------------------------------ static bool arg_cli(int argc, char **argv) { - #if defined(AMIGA) + // Temp AxRT workaround until argument handling in AxRT is implemented. + #if defined(AMIGA) && !defined(__AXRT__) // Not used on Amiga. (void) argc; (void) argv; @@ -238,8 +239,13 @@ bool arg_init(int argc, char **argv) // Invoked from CLI or WB. bool init = argc ? arg_cli(argc, argv) : arg_wb(argv); - // Go to script working directory and return. - return init && args[ARG_HOMEDIR] && !chdir(args[ARG_HOMEDIR]); + // Go to script working directory and return. Temp AxRT workaround until + // argument handling in AxRT is implemented. + return init && args[ARG_HOMEDIR] + #ifndef __AXRT__ + && !chdir(args[ARG_HOMEDIR]) + #endif + ; } //------------------------------------------------------------------------------ diff --git a/src/lexer.l b/src/lexer.l index 17e1c49f..654dad6b 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -269,8 +269,18 @@ int main(int argc, char **argv) // Assume failure. int ret = -1; +#ifdef __AXRT__ + (void) argc; + (void) argv; + + // Temp AxRT workaround until argument handling in AxRT is implemented. + char *argv_[] = {"Installer", "axrt.script", NULL}; + + if(arg_init(2, argv_)) +#else // Initialize the argument handling. if(arg_init(argc, argv)) +#endif { yyscan_t lexer; From 25df1e44b7c868e025b5713df98bf480668cddc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Mon, 1 Jun 2020 22:45:05 +0200 Subject: [PATCH 12/20] Lexer updated. --- build/lexer.c | 830 ++++++++++++++++++++++++++------------------------ 1 file changed, 430 insertions(+), 400 deletions(-) diff --git a/build/lexer.c b/build/lexer.c index e5ed633e..1fe60996 100644 --- a/build/lexer.c +++ b/build/lexer.c @@ -1,5 +1,5 @@ -#line 3 "" +#line 2 "" #define YY_INT_ALIGNED short int @@ -7,12 +7,24 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yyget_lval +#define yyget_lval_ALREADY_DEFINED +#else +#define yyget_lval yyget_lval +#endif + +#ifdef yyset_lval +#define yyset_lval_ALREADY_DEFINED +#else +#define yyset_lval yyset_lval +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -46,7 +58,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -54,7 +65,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,38 +95,32 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -140,25 +144,29 @@ typedef void* yyscan_t; * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ,yyscanner ) - +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -178,8 +186,9 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -194,7 +203,6 @@ typedef size_t yy_size_t; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -209,12 +217,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -237,7 +245,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -271,84 +279,77 @@ struct yy_buffer_state #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); - -static void yyensure_buffer_stack (yyscan_t yyscanner ); -static void yy_load_buffer_state (yyscan_t yyscanner ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; - #define YY_NUM_RULES 155 #define YY_END_OF_BUFFER 156 /* This struct is not used in this scanner, @@ -358,7 +359,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[717] = +static const flex_int16_t yy_accept[717] = { 0, 0, 0, 0, 0, 156, 145, 149, 147, 148, 155, 145, 145, 155, 4, 5, 14, 12, 13, 15, 1, @@ -441,7 +442,7 @@ static yyconst flex_int16_t yy_accept[717] = 97, 145, 145, 112, 132, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -473,7 +474,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[76] = +static const YY_CHAR yy_meta[76] = { 0, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, @@ -485,7 +486,7 @@ static yyconst flex_int32_t yy_meta[76] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[723] = +static const flex_int16_t yy_base[723] = { 0, 0, 0, 73, 75, 205, 0, 172, 1464, 154, 75, 108, 139, 73, 1464, 1464, 1464, 1464, 66, 1464, 70, @@ -569,7 +570,7 @@ static yyconst flex_int16_t yy_base[723] = 1459, 1461 } ; -static yyconst flex_int16_t yy_def[723] = +static const flex_int16_t yy_def[723] = { 0, 716, 1, 717, 717, 716, 718, 716, 716, 716, 719, 718, 718, 720, 716, 716, 716, 716, 718, 716, 718, @@ -653,7 +654,7 @@ static yyconst flex_int16_t yy_def[723] = 716, 716 } ; -static yyconst flex_int16_t yy_nxt[1540] = +static const flex_int16_t yy_nxt[1540] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 6, 19, 20, 20, 21, 22, 23, @@ -826,7 +827,7 @@ static yyconst flex_int16_t yy_nxt[1540] = 716, 716, 716, 716, 716, 716, 716, 716, 716 } ; -static yyconst flex_int16_t yy_chk[1540] = +static const flex_int16_t yy_chk[1540] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1032,11 +1033,13 @@ static FILE *script; /* strduptr(const char *str) - Duplicate string and translate escape characters according to the Installer V42.6 guide */ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ static char *strduptr(const char *str); -/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -/* We need the parser to be reentrant, not because we want to, but because it will will leak memory otherwise. */ -/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#line 1036 "" +#line 28 "../src/lexer.l" + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + /* We need the parser to be reentrant, not because we want to, but because it will will leak memory otherwise. */ + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#line 1040 "" +#line 1042 "" #define INITIAL 0 #define comment 1 @@ -1066,8 +1069,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -1089,7 +1092,7 @@ struct yyguts_t }; /* end struct yyguts_t */ -static int yy_init_globals (yyscan_t yyscanner ); +static int yy_init_globals ( yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ @@ -1097,40 +1100,44 @@ static int yy_init_globals (yyscan_t yyscanner ); int yylex_init (yyscan_t* scanner); -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); -int yyget_debug (yyscan_t yyscanner ); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -FILE *yyget_in (yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -FILE *yyget_out (yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -yy_size_t yyget_leng (yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -char *yyget_text (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -int yyget_lineno (yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -void yyset_lineno (int line_number ,yyscan_t yyscanner ); +int yyget_column ( yyscan_t yyscanner ); -YYSTYPE * yyget_lval (yyscan_t yyscanner ); +void yyset_column ( int _column_no , yyscan_t yyscanner ); -void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); + +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1138,35 +1145,43 @@ void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif - static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); +static int yyinput ( yyscan_t yyscanner ); #else -static int input (yyscan_t yyscanner ); +static int input ( yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1174,7 +1189,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1185,7 +1200,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1198,7 +1213,7 @@ static int input (yyscan_t yyscanner ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1240,7 +1255,7 @@ static int input (yyscan_t yyscanner ); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); + (YYSTYPE * yylval_param , yyscan_t yyscanner); #define YY_DECL int yylex \ (YYSTYPE * yylval_param , yyscan_t yyscanner) @@ -1255,7 +1270,7 @@ extern int yylex \ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1265,18 +1280,11 @@ extern int yylex \ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 33 "../src/lexer.l" - - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - /* Decimal numbers */ - /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -#line 1279 "" - yylval = yylval_param; if ( !yyg->yy_init ) @@ -1299,13 +1307,21 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 34 "../src/lexer.l" + + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + /* Decimal numbers */ + /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#line 1322 "" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -1321,7 +1337,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1331,9 +1347,9 @@ YY_DECL { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1464 ); @@ -1362,7 +1378,7 @@ YY_DECL case 1: YY_RULE_SETUP -#line 37 "../src/lexer.l" +#line 38 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext, NULL, 10); return INT; @@ -1373,7 +1389,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 2: YY_RULE_SETUP -#line 45 "../src/lexer.l" +#line 46 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext + 1, NULL, 16); return HEX; @@ -1384,7 +1400,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 3: YY_RULE_SETUP -#line 53 "../src/lexer.l" +#line 54 "../src/lexer.l" { yylval->n = (int32_t) strtoul(yytext + 1, NULL, 2); return BIN; @@ -1395,12 +1411,12 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 4: YY_RULE_SETUP -#line 61 "../src/lexer.l" +#line 62 "../src/lexer.l" { return '('; } YY_BREAK case 5: YY_RULE_SETUP -#line 62 "../src/lexer.l" +#line 63 "../src/lexer.l" { return ')'; } YY_BREAK /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -1408,687 +1424,687 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 6: YY_RULE_SETUP -#line 67 "../src/lexer.l" +#line 68 "../src/lexer.l" { return '='; } YY_BREAK case 7: YY_RULE_SETUP -#line 68 "../src/lexer.l" +#line 69 "../src/lexer.l" { return '<'; } YY_BREAK case 8: YY_RULE_SETUP -#line 69 "../src/lexer.l" +#line 70 "../src/lexer.l" { return LTE; } YY_BREAK case 9: YY_RULE_SETUP -#line 70 "../src/lexer.l" +#line 71 "../src/lexer.l" { return '>'; } YY_BREAK case 10: YY_RULE_SETUP -#line 71 "../src/lexer.l" +#line 72 "../src/lexer.l" { return GTE; } YY_BREAK case 11: YY_RULE_SETUP -#line 72 "../src/lexer.l" +#line 73 "../src/lexer.l" { return NEQ; } YY_BREAK case 12: YY_RULE_SETUP -#line 73 "../src/lexer.l" +#line 74 "../src/lexer.l" { return '+'; } YY_BREAK case 13: YY_RULE_SETUP -#line 74 "../src/lexer.l" +#line 75 "../src/lexer.l" { return '-'; } YY_BREAK case 14: YY_RULE_SETUP -#line 75 "../src/lexer.l" +#line 76 "../src/lexer.l" { return '*'; } YY_BREAK case 15: YY_RULE_SETUP -#line 76 "../src/lexer.l" +#line 77 "../src/lexer.l" { return '/'; } YY_BREAK case 16: YY_RULE_SETUP -#line 77 "../src/lexer.l" +#line 78 "../src/lexer.l" { return AND; } YY_BREAK case 17: YY_RULE_SETUP -#line 78 "../src/lexer.l" +#line 79 "../src/lexer.l" { return OR; } YY_BREAK case 18: YY_RULE_SETUP -#line 79 "../src/lexer.l" +#line 80 "../src/lexer.l" { return XOR; } YY_BREAK case 19: YY_RULE_SETUP -#line 80 "../src/lexer.l" +#line 81 "../src/lexer.l" { return NOT; } YY_BREAK case 20: YY_RULE_SETUP -#line 81 "../src/lexer.l" +#line 82 "../src/lexer.l" { return BITAND; } YY_BREAK case 21: YY_RULE_SETUP -#line 82 "../src/lexer.l" +#line 83 "../src/lexer.l" { return BITOR; } YY_BREAK case 22: YY_RULE_SETUP -#line 83 "../src/lexer.l" +#line 84 "../src/lexer.l" { return BITXOR; } YY_BREAK case 23: YY_RULE_SETUP -#line 84 "../src/lexer.l" +#line 85 "../src/lexer.l" { return BITNOT; } YY_BREAK case 24: YY_RULE_SETUP -#line 85 "../src/lexer.l" +#line 86 "../src/lexer.l" { return SHIFTLEFT; } YY_BREAK case 25: YY_RULE_SETUP -#line 86 "../src/lexer.l" +#line 87 "../src/lexer.l" { return SHIFTRIGHT; } YY_BREAK case 26: YY_RULE_SETUP -#line 87 "../src/lexer.l" +#line 88 "../src/lexer.l" { return IN; } YY_BREAK case 27: YY_RULE_SETUP -#line 88 "../src/lexer.l" +#line 89 "../src/lexer.l" { return SET; } YY_BREAK case 28: YY_RULE_SETUP -#line 89 "../src/lexer.l" +#line 90 "../src/lexer.l" { return DCL; } YY_BREAK case 29: YY_RULE_SETUP -#line 90 "../src/lexer.l" +#line 91 "../src/lexer.l" { return IF; } YY_BREAK case 30: YY_RULE_SETUP -#line 91 "../src/lexer.l" +#line 92 "../src/lexer.l" { return WHILE; } YY_BREAK case 31: YY_RULE_SETUP -#line 92 "../src/lexer.l" +#line 93 "../src/lexer.l" { return UNTIL; } YY_BREAK case 32: YY_RULE_SETUP -#line 93 "../src/lexer.l" +#line 94 "../src/lexer.l" { return TRACE; } YY_BREAK case 33: YY_RULE_SETUP -#line 94 "../src/lexer.l" +#line 95 "../src/lexer.l" { return RETRACE; } YY_BREAK case 34: YY_RULE_SETUP -#line 95 "../src/lexer.l" +#line 96 "../src/lexer.l" { return STRLEN; } YY_BREAK case 35: YY_RULE_SETUP -#line 96 "../src/lexer.l" +#line 97 "../src/lexer.l" { return SUBSTR; } YY_BREAK case 36: YY_RULE_SETUP -#line 97 "../src/lexer.l" +#line 98 "../src/lexer.l" { return ASKDIR; } YY_BREAK case 37: YY_RULE_SETUP -#line 98 "../src/lexer.l" +#line 99 "../src/lexer.l" { return ASKFILE; } YY_BREAK case 38: YY_RULE_SETUP -#line 99 "../src/lexer.l" +#line 100 "../src/lexer.l" { return ASKSTRING; } YY_BREAK case 39: YY_RULE_SETUP -#line 100 "../src/lexer.l" +#line 101 "../src/lexer.l" { return ASKNUMBER; } YY_BREAK case 40: YY_RULE_SETUP -#line 101 "../src/lexer.l" +#line 102 "../src/lexer.l" { return ASKCHOICE; } YY_BREAK case 41: YY_RULE_SETUP -#line 102 "../src/lexer.l" +#line 103 "../src/lexer.l" { return ASKOPTIONS; } YY_BREAK case 42: YY_RULE_SETUP -#line 103 "../src/lexer.l" +#line 104 "../src/lexer.l" { return ASKBOOL; } YY_BREAK case 43: YY_RULE_SETUP -#line 104 "../src/lexer.l" +#line 105 "../src/lexer.l" { return ASKDISK; } YY_BREAK case 44: YY_RULE_SETUP -#line 105 "../src/lexer.l" +#line 106 "../src/lexer.l" { return CAT; } YY_BREAK case 45: YY_RULE_SETUP -#line 106 "../src/lexer.l" +#line 107 "../src/lexer.l" { return EXISTS; } YY_BREAK case 46: YY_RULE_SETUP -#line 107 "../src/lexer.l" +#line 108 "../src/lexer.l" { return EXPANDPATH; } YY_BREAK case 47: YY_RULE_SETUP -#line 108 "../src/lexer.l" +#line 109 "../src/lexer.l" { return EARLIER; } YY_BREAK case 48: YY_RULE_SETUP -#line 109 "../src/lexer.l" +#line 110 "../src/lexer.l" { return FILEONLY; } YY_BREAK case 49: YY_RULE_SETUP -#line 110 "../src/lexer.l" +#line 111 "../src/lexer.l" { return GETASSIGN; } YY_BREAK case 50: YY_RULE_SETUP -#line 111 "../src/lexer.l" +#line 112 "../src/lexer.l" { return GETDEVICE; } YY_BREAK case 51: YY_RULE_SETUP -#line 112 "../src/lexer.l" +#line 113 "../src/lexer.l" { return GETDISKSPACE; } YY_BREAK case 52: YY_RULE_SETUP -#line 113 "../src/lexer.l" +#line 114 "../src/lexer.l" { return GETENV; } YY_BREAK case 53: YY_RULE_SETUP -#line 114 "../src/lexer.l" +#line 115 "../src/lexer.l" { return GETSIZE; } YY_BREAK case 54: YY_RULE_SETUP -#line 115 "../src/lexer.l" +#line 116 "../src/lexer.l" { return GETSUM; } YY_BREAK case 55: YY_RULE_SETUP -#line 116 "../src/lexer.l" +#line 117 "../src/lexer.l" { return GETVERSION; } YY_BREAK case 56: YY_RULE_SETUP -#line 117 "../src/lexer.l" +#line 118 "../src/lexer.l" { return ICONINFO; } YY_BREAK case 57: YY_RULE_SETUP -#line 118 "../src/lexer.l" +#line 119 "../src/lexer.l" { return QUERYDISPLAY; } YY_BREAK case 58: YY_RULE_SETUP -#line 119 "../src/lexer.l" +#line 120 "../src/lexer.l" { return PATHONLY; } YY_BREAK case 59: YY_RULE_SETUP -#line 120 "../src/lexer.l" +#line 121 "../src/lexer.l" { return PATMATCH; } YY_BREAK case 60: YY_RULE_SETUP -#line 121 "../src/lexer.l" +#line 122 "../src/lexer.l" { return SELECT; } YY_BREAK case 61: YY_RULE_SETUP -#line 122 "../src/lexer.l" +#line 123 "../src/lexer.l" { return SYMBOLSET; } YY_BREAK case 62: YY_RULE_SETUP -#line 123 "../src/lexer.l" +#line 124 "../src/lexer.l" { return SYMBOLVAL; } YY_BREAK case 63: YY_RULE_SETUP -#line 124 "../src/lexer.l" +#line 125 "../src/lexer.l" { return TACKON; } YY_BREAK case 64: YY_RULE_SETUP -#line 125 "../src/lexer.l" +#line 126 "../src/lexer.l" { return TRANSCRIPT; } YY_BREAK case 65: YY_RULE_SETUP -#line 126 "../src/lexer.l" +#line 127 "../src/lexer.l" { return COMPLETE; } YY_BREAK case 66: YY_RULE_SETUP -#line 127 "../src/lexer.l" +#line 128 "../src/lexer.l" { return CLOSEMEDIA; } YY_BREAK case 67: YY_RULE_SETUP -#line 128 "../src/lexer.l" +#line 129 "../src/lexer.l" { return EFFECT; } YY_BREAK case 68: YY_RULE_SETUP -#line 129 "../src/lexer.l" +#line 130 "../src/lexer.l" { return SETMEDIA; } YY_BREAK case 69: YY_RULE_SETUP -#line 130 "../src/lexer.l" +#line 131 "../src/lexer.l" { return SHOWMEDIA; } YY_BREAK case 70: YY_RULE_SETUP -#line 131 "../src/lexer.l" +#line 132 "../src/lexer.l" { return USER; } YY_BREAK case 71: YY_RULE_SETUP -#line 132 "../src/lexer.l" +#line 133 "../src/lexer.l" { return WORKING; } YY_BREAK case 72: YY_RULE_SETUP -#line 133 "../src/lexer.l" +#line 134 "../src/lexer.l" { return WELCOME; } YY_BREAK case 73: YY_RULE_SETUP -#line 134 "../src/lexer.l" +#line 135 "../src/lexer.l" { return ABORT; } YY_BREAK case 74: YY_RULE_SETUP -#line 135 "../src/lexer.l" +#line 136 "../src/lexer.l" { return COPYFILES; } YY_BREAK case 75: YY_RULE_SETUP -#line 136 "../src/lexer.l" +#line 137 "../src/lexer.l" { return COPYLIB; } YY_BREAK case 76: YY_RULE_SETUP -#line 137 "../src/lexer.l" +#line 138 "../src/lexer.l" { return DATABASE; } YY_BREAK case 77: YY_RULE_SETUP -#line 138 "../src/lexer.l" +#line 139 "../src/lexer.l" { return DEBUG; } YY_BREAK case 78: YY_RULE_SETUP -#line 139 "../src/lexer.l" +#line 140 "../src/lexer.l" { return DELETE; } YY_BREAK case 79: YY_RULE_SETUP -#line 140 "../src/lexer.l" +#line 141 "../src/lexer.l" { return EXECUTE; } YY_BREAK case 80: YY_RULE_SETUP -#line 141 "../src/lexer.l" +#line 142 "../src/lexer.l" { return EXIT; } YY_BREAK case 81: YY_RULE_SETUP -#line 142 "../src/lexer.l" +#line 143 "../src/lexer.l" { return FOREACH; } YY_BREAK case 82: YY_RULE_SETUP -#line 143 "../src/lexer.l" +#line 144 "../src/lexer.l" { return MAKEASSIGN; } YY_BREAK case 83: YY_RULE_SETUP -#line 144 "../src/lexer.l" +#line 145 "../src/lexer.l" { return MAKEDIR; } YY_BREAK case 84: YY_RULE_SETUP -#line 145 "../src/lexer.l" +#line 146 "../src/lexer.l" { return MESSAGE; } YY_BREAK case 85: YY_RULE_SETUP -#line 146 "../src/lexer.l" +#line 147 "../src/lexer.l" { return ONERROR; } YY_BREAK case 86: YY_RULE_SETUP -#line 147 "../src/lexer.l" +#line 148 "../src/lexer.l" { return PROTECT; } YY_BREAK case 87: YY_RULE_SETUP -#line 148 "../src/lexer.l" +#line 149 "../src/lexer.l" { return RENAME; } YY_BREAK case 88: YY_RULE_SETUP -#line 149 "../src/lexer.l" +#line 150 "../src/lexer.l" { return REXX; } YY_BREAK case 89: YY_RULE_SETUP -#line 150 "../src/lexer.l" +#line 151 "../src/lexer.l" { return RUN; } YY_BREAK case 90: YY_RULE_SETUP -#line 151 "../src/lexer.l" +#line 152 "../src/lexer.l" { return STARTUP; } YY_BREAK case 91: YY_RULE_SETUP -#line 152 "../src/lexer.l" +#line 153 "../src/lexer.l" { return TEXTFILE; } YY_BREAK case 92: YY_RULE_SETUP -#line 153 "../src/lexer.l" +#line 154 "../src/lexer.l" { return TOOLTYPE; } YY_BREAK case 93: YY_RULE_SETUP -#line 154 "../src/lexer.l" +#line 155 "../src/lexer.l" { return TRAP; } YY_BREAK case 94: YY_RULE_SETUP -#line 155 "../src/lexer.l" +#line 156 "../src/lexer.l" { return REBOOT; } YY_BREAK case 95: YY_RULE_SETUP -#line 156 "../src/lexer.l" +#line 157 "../src/lexer.l" { return OPENWBOBJECT; } YY_BREAK case 96: YY_RULE_SETUP -#line 157 "../src/lexer.l" +#line 158 "../src/lexer.l" { return SHOWWBOBJECT; } YY_BREAK case 97: YY_RULE_SETUP -#line 158 "../src/lexer.l" +#line 159 "../src/lexer.l" { return CLOSEWBOBJECT; } YY_BREAK case 98: YY_RULE_SETUP -#line 159 "../src/lexer.l" +#line 160 "../src/lexer.l" { return ALL; } YY_BREAK case 99: YY_RULE_SETUP -#line 160 "../src/lexer.l" +#line 161 "../src/lexer.l" { return APPEND; } YY_BREAK case 100: YY_RULE_SETUP -#line 161 "../src/lexer.l" +#line 162 "../src/lexer.l" { return ASSIGNS; } YY_BREAK case 101: YY_RULE_SETUP -#line 162 "../src/lexer.l" +#line 163 "../src/lexer.l" { return BACK; } YY_BREAK case 102: YY_RULE_SETUP -#line 163 "../src/lexer.l" +#line 164 "../src/lexer.l" { return CHOICES; } YY_BREAK case 103: YY_RULE_SETUP -#line 164 "../src/lexer.l" +#line 165 "../src/lexer.l" { return COMMAND; } YY_BREAK case 104: YY_RULE_SETUP -#line 165 "../src/lexer.l" +#line 166 "../src/lexer.l" { return COMPRESSION; } YY_BREAK case 105: YY_RULE_SETUP -#line 166 "../src/lexer.l" +#line 167 "../src/lexer.l" { return CONFIRM; } YY_BREAK case 106: YY_RULE_SETUP -#line 167 "../src/lexer.l" +#line 168 "../src/lexer.l" { return DEFAULT; } YY_BREAK case 107: YY_RULE_SETUP -#line 168 "../src/lexer.l" +#line 169 "../src/lexer.l" { return DELOPTS; } YY_BREAK case 108: YY_RULE_SETUP -#line 169 "../src/lexer.l" +#line 170 "../src/lexer.l" { return DEST; } YY_BREAK case 109: YY_RULE_SETUP -#line 170 "../src/lexer.l" +#line 171 "../src/lexer.l" { return DISK; } YY_BREAK case 110: YY_RULE_SETUP -#line 171 "../src/lexer.l" +#line 172 "../src/lexer.l" { return FILES; } YY_BREAK case 111: YY_RULE_SETUP -#line 172 "../src/lexer.l" +#line 173 "../src/lexer.l" { return FONTS; } YY_BREAK case 112: YY_RULE_SETUP -#line 173 "../src/lexer.l" +#line 174 "../src/lexer.l" { return GETDEFAULTTOOL; } YY_BREAK case 113: YY_RULE_SETUP -#line 174 "../src/lexer.l" +#line 175 "../src/lexer.l" { return GETPOSITION; } YY_BREAK case 114: YY_RULE_SETUP -#line 175 "../src/lexer.l" +#line 176 "../src/lexer.l" { return GETSTACK; } YY_BREAK case 115: YY_RULE_SETUP -#line 176 "../src/lexer.l" +#line 177 "../src/lexer.l" { return GETTOOLTYPE; } YY_BREAK case 116: YY_RULE_SETUP -#line 177 "../src/lexer.l" +#line 178 "../src/lexer.l" { return HELP; } YY_BREAK case 117: YY_RULE_SETUP -#line 178 "../src/lexer.l" +#line 179 "../src/lexer.l" { return INFOS; } YY_BREAK case 118: YY_RULE_SETUP -#line 179 "../src/lexer.l" +#line 180 "../src/lexer.l" { return INCLUDE; } YY_BREAK case 119: YY_RULE_SETUP -#line 180 "../src/lexer.l" +#line 181 "../src/lexer.l" { return NEWNAME; } YY_BREAK case 120: YY_RULE_SETUP -#line 181 "../src/lexer.l" +#line 182 "../src/lexer.l" { return NEWPATH; } YY_BREAK case 121: YY_RULE_SETUP -#line 182 "../src/lexer.l" +#line 183 "../src/lexer.l" { return NOGAUGE; } YY_BREAK case 122: YY_RULE_SETUP -#line 183 "../src/lexer.l" +#line 184 "../src/lexer.l" { return NOPOSITION; } YY_BREAK case 123: YY_RULE_SETUP -#line 184 "../src/lexer.l" +#line 185 "../src/lexer.l" { return NOREQ; } YY_BREAK case 124: YY_RULE_SETUP -#line 185 "../src/lexer.l" +#line 186 "../src/lexer.l" { return OPTIONAL; } YY_BREAK case 125: YY_RULE_SETUP -#line 186 "../src/lexer.l" +#line 187 "../src/lexer.l" { return OVERRIDE; } YY_BREAK case 126: YY_RULE_SETUP -#line 187 "../src/lexer.l" +#line 188 "../src/lexer.l" { return PATTERN; } YY_BREAK case 127: YY_RULE_SETUP -#line 188 "../src/lexer.l" +#line 189 "../src/lexer.l" { return PROMPT; } YY_BREAK case 128: YY_RULE_SETUP -#line 189 "../src/lexer.l" +#line 190 "../src/lexer.l" { return QUIET; } YY_BREAK case 129: YY_RULE_SETUP -#line 190 "../src/lexer.l" +#line 191 "../src/lexer.l" { return RANGE; } YY_BREAK case 130: YY_RULE_SETUP -#line 191 "../src/lexer.l" +#line 192 "../src/lexer.l" { return RESIDENT; } YY_BREAK case 131: YY_RULE_SETUP -#line 192 "../src/lexer.l" +#line 193 "../src/lexer.l" { return SAFE; } YY_BREAK case 132: YY_RULE_SETUP -#line 193 "../src/lexer.l" +#line 194 "../src/lexer.l" { return SETDEFAULTTOOL; } YY_BREAK case 133: YY_RULE_SETUP -#line 194 "../src/lexer.l" +#line 195 "../src/lexer.l" { return SETSTACK; } YY_BREAK case 134: YY_RULE_SETUP -#line 195 "../src/lexer.l" +#line 196 "../src/lexer.l" { return SETTOOLTYPE; } YY_BREAK case 135: YY_RULE_SETUP -#line 196 "../src/lexer.l" +#line 197 "../src/lexer.l" { return SETPOSITION; } YY_BREAK case 136: YY_RULE_SETUP -#line 197 "../src/lexer.l" +#line 198 "../src/lexer.l" { return SOURCE; } YY_BREAK case 137: YY_RULE_SETUP -#line 198 "../src/lexer.l" +#line 199 "../src/lexer.l" { return SWAPCOLORS; } YY_BREAK case 138: YY_RULE_SETUP -#line 199 "../src/lexer.l" +#line 200 "../src/lexer.l" { return ASTRAW; } YY_BREAK case 139: YY_RULE_SETUP -#line 200 "../src/lexer.l" +#line 201 "../src/lexer.l" { return ASBRAW; } YY_BREAK case 140: YY_RULE_SETUP -#line 201 "../src/lexer.l" +#line 202 "../src/lexer.l" { return ASBEVAL; } YY_BREAK case 141: YY_RULE_SETUP -#line 202 "../src/lexer.l" +#line 203 "../src/lexer.l" { return EVAL; } YY_BREAK case 142: YY_RULE_SETUP -#line 203 "../src/lexer.l" +#line 204 "../src/lexer.l" { return OPTIONS; } YY_BREAK /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -2096,11 +2112,11 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 143: /* rule 143 can match eol */ -#line 209 "../src/lexer.l" +#line 210 "../src/lexer.l" case 144: /* rule 144 can match eol */ YY_RULE_SETUP -#line 209 "../src/lexer.l" +#line 210 "../src/lexer.l" { yylval->s = strduptr(yytext); return yylval->s ? STR : OOM; @@ -2111,7 +2127,7 @@ YY_RULE_SETUP /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ case 145: YY_RULE_SETUP -#line 217 "../src/lexer.l" +#line 218 "../src/lexer.l" { yylval->s = strdup(yytext); return yylval->s ? SYM : OOM; @@ -2123,63 +2139,63 @@ YY_RULE_SETUP case 146: /* rule 146 can match eol */ YY_RULE_SETUP -#line 225 "../src/lexer.l" +#line 226 "../src/lexer.l" { yylineno++; } YY_BREAK case 147: /* rule 147 can match eol */ YY_RULE_SETUP -#line 226 "../src/lexer.l" +#line 227 "../src/lexer.l" { yylineno++; } YY_BREAK case 148: YY_RULE_SETUP -#line 227 "../src/lexer.l" +#line 228 "../src/lexer.l" { yylineno++; } YY_BREAK case 149: YY_RULE_SETUP -#line 228 "../src/lexer.l" +#line 229 "../src/lexer.l" { } YY_BREAK case 150: YY_RULE_SETUP -#line 229 "../src/lexer.l" +#line 230 "../src/lexer.l" { BEGIN(comment); } YY_BREAK case 151: /* rule 151 can match eol */ YY_RULE_SETUP -#line 230 "../src/lexer.l" +#line 231 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 152: /* rule 152 can match eol */ YY_RULE_SETUP -#line 231 "../src/lexer.l" +#line 232 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 153: YY_RULE_SETUP -#line 232 "../src/lexer.l" +#line 233 "../src/lexer.l" { BEGIN(INITIAL); yylineno++; } YY_BREAK case 154: YY_RULE_SETUP -#line 233 "../src/lexer.l" +#line 234 "../src/lexer.l" { } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): -#line 234 "../src/lexer.l" +#line 235 "../src/lexer.l" { fclose(script); script = NULL; yyterminate(); } YY_BREAK case 155: YY_RULE_SETUP -#line 235 "../src/lexer.l" +#line 236 "../src/lexer.l" ECHO; YY_BREAK -#line 2183 "" +#line 2198 "" case YY_END_OF_BUFFER: { @@ -2255,7 +2271,7 @@ ECHO; { yyg->yy_did_buffer_switch_on_eof = 0; - if ( yywrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2308,6 +2324,7 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2320,9 +2337,9 @@ ECHO; static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -2351,7 +2368,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2364,21 +2381,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2387,11 +2404,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2419,7 +2437,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); } else @@ -2433,12 +2451,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } yyg->yy_n_chars += number_to_move; @@ -2454,15 +2475,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -2472,9 +2493,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -2487,11 +2508,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -2501,17 +2522,20 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 717 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 716); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) { - register char *yy_cp; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_cp = yyg->yy_c_buf_p; @@ -2522,10 +2546,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = yyg->yy_n_chars + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2534,7 +2558,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2547,6 +2571,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -2572,7 +2598,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2589,13 +2615,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - yyrestart(yyin ,yyscanner); + yyrestart( yyin , yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap(yyscanner ) ) + if ( yywrap( yyscanner ) ) return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) @@ -2634,11 +2660,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - yy_load_buffer_state(yyscanner ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /** Switch to a different input buffer. @@ -2667,7 +2693,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2696,7 +2722,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2705,13 +2731,13 @@ static void yy_load_buffer_state (yyscan_t yyscanner) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ,yyscanner); + yy_init_buffer( b, file , yyscanner); return b; } @@ -2731,15 +2757,11 @@ static void yy_load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ,yyscanner ); + yyfree( (void *) b->yy_ch_buf , yyscanner ); - yyfree((void *) b ,yyscanner ); + yyfree( (void *) b , yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -2750,7 +2772,7 @@ extern int isatty (int ); int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flush_buffer(b ,yyscanner); + yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2794,7 +2816,7 @@ extern int isatty (int ); b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -2826,7 +2848,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -2840,13 +2862,13 @@ void yypop_buffer_state (yyscan_t yyscanner) if (!YY_CURRENT_BUFFER) return; - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(yyscanner ); + yy_load_buffer_state( yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -2865,15 +2887,15 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -2882,7 +2904,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc @@ -2902,7 +2924,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { @@ -2912,23 +2934,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ,yyscanner ); + yy_switch_to_buffer( b , yyscanner ); return b; } @@ -2941,28 +2963,29 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; - yy_size_t n, i; + yy_size_t n; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ,yyscanner ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2971,7 +2994,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ,yyscanner); + b = yy_scan_buffer( buf, n , yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -2987,9 +3010,11 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3027,7 +3052,7 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3040,7 +3065,7 @@ int yyget_lineno (yyscan_t yyscanner) int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; @@ -3068,7 +3093,7 @@ FILE *yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t yyget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3095,51 +3120,51 @@ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void yyset_lineno (int line_number , yyscan_t yyscanner) +void yyset_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); - yylineno = line_number; + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void yyset_column (int column_no , yyscan_t yyscanner) +void yyset_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "yyset_column called with no buffer" ); - yycolumn = column_no; + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str , yyscan_t yyscanner) +void yyset_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str , yyscan_t yyscanner) +void yyset_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (yyscan_t yyscanner) @@ -3148,10 +3173,10 @@ int yyget_debug (yyscan_t yyscanner) return yy_flex_debug; } -void yyset_debug (int bdebug , yyscan_t yyscanner) +void yyset_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ @@ -3174,9 +3199,7 @@ void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ - int yylex_init(yyscan_t* ptr_yy_globals) - { if (ptr_yy_globals == NULL){ errno = EINVAL; @@ -3203,9 +3226,7 @@ int yylex_init(yyscan_t* ptr_yy_globals) * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ - -int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; @@ -3215,20 +3236,20 @@ int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } @@ -3239,10 +3260,10 @@ static int yy_init_globals (yyscan_t yyscanner) * This function is called from yylex_destroy(), so don't allocate here. */ - yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack = NULL; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; + yyg->yy_c_buf_p = NULL; yyg->yy_init = 0; yyg->yy_start = 0; @@ -3255,8 +3276,8 @@ static int yy_init_globals (yyscan_t yyscanner) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -3272,17 +3293,17 @@ int yylex_destroy (yyscan_t yyscanner) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack ,yyscanner); + yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree(yyg->yy_start_stack ,yyscanner ); + yyfree( yyg->yy_start_stack , yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time @@ -3300,18 +3321,21 @@ int yylex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) { - register int i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3321,11 +3345,16 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) void *yyalloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3333,18 +3362,19 @@ void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void yyfree (void * ptr , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 235 "../src/lexer.l" - +#line 236 "../src/lexer.l" /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -3410,7 +3440,7 @@ int main(int argc, char **argv) if(script) { // Set input file and parse. - yyset_in(script,lexer); + yyset_in(script, lexer); // 1 on syntax error, 0 on success. ret = yyparse(lexer); From e8d41c8118191638b5d7696840496fd0b05887e9 Mon Sep 17 00:00:00 2001 From: Stefan Haubenthal Date: Thu, 4 Jun 2020 13:51:26 +0200 Subject: [PATCH 13/20] Unified options, CGEN was missing --- build/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Makefile b/build/Makefile index c8fab3b1..b984014b 100644 --- a/build/Makefile +++ b/build/Makefile @@ -63,10 +63,10 @@ $(EXE): $(OBJ) parser.o lexer.o $(CC) $^ -o $@ $(LDLIBS) parser.o: parser.c - $(CC) $(CINC) $(CDEF) $(CGEN) -c $< -DYYERROR_VERBOSE + $(CC) $(CFLAGS) -c $< -DYYERROR_VERBOSE lexer.o: lexer.c - $(CC) $(CINC) $(CDEF) $(CGEN) -c $< + $(CC) $(CFLAGS) -Wno-unused-function -c $< parser.c: parser.y ifneq ($(AMIGA),true) @@ -85,7 +85,7 @@ else endif gui.o: gui.c gui.h version.h - $(CC) -Os -c $< -DLLVL=2 $(CWRN) $(CDEF) + $(CC) $(CFLAGS) -Os -c $< -DLLVL=2 #---------------------------------------------------------------------------------# # Catalogs From 3d60e3a485037c756ab7d20fc05e71026f4b5e52 Mon Sep 17 00:00:00 2001 From: Stefan Haubenthal Date: Fri, 5 Jun 2020 19:35:08 +0200 Subject: [PATCH 14/20] Fixed CI --- build/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile b/build/Makefile index b984014b..cf2c199f 100644 --- a/build/Makefile +++ b/build/Makefile @@ -66,7 +66,7 @@ parser.o: parser.c $(CC) $(CFLAGS) -c $< -DYYERROR_VERBOSE lexer.o: lexer.c - $(CC) $(CFLAGS) -Wno-unused-function -c $< + $(CC) $(CINC) $(CDEF) $(CGEN) -c $< parser.c: parser.y ifneq ($(AMIGA),true) From c0a38f940558425863d8e3c125008645e5eeb8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Mon, 1 Jun 2020 14:10:57 +0200 Subject: [PATCH 15/20] Remove typecasting quirks. --- src/gui.c | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/src/gui.c b/src/gui.c index 2d14a8e6..8ba1fd40 100644 --- a/src/gui.c +++ b/src/gui.c @@ -83,7 +83,6 @@ APTR STDARGS DoSuperNew(struct IClass *cl, APTR obj, IPTR tag1, ...) #define DISPATCH(C) static IPTR C ## Dispatch (DISPATCH_ARGS) #define CLASS_DATA(C) C ## Data #define TAGBASE_LG (TAG_USER | 27<<16) -#define CAST(P,T) ((T) ((uintptr_t) P)) #define MUIDSP static inline IPTR __attribute__((always_inline)) //------------------------------------------------------------------------------ @@ -847,10 +846,8 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) if(msg->MinLevel == 1) { // Minimum user level 'average'. - get(my->ExpertLevel, MUIA_Radio_Active, - CAST(msg->Level, int32_t *)); - - (*CAST(msg->Level, int32_t *))++; + get(my->ExpertLevel, MUIA_Radio_Active, &msg->Level); + msg->Level++; } else { @@ -935,7 +932,7 @@ static IPTR IGDirPart(Class *cls, Object *obj, IPTR Path) struct IGData *my = INST_DATA(cls, obj); // Copy path string. - strncpy(my->Buf, CAST(Path, const char *), sizeof(my->Buf)); + strncpy(my->Buf, (const char *) Path, sizeof(my->Buf)); struct Process *p = (struct Process *) FindTask(NULL); @@ -977,7 +974,7 @@ static IPTR IGDirPart(Class *cls, Object *obj, IPTR Path) // Restore auto request. p->pr_WindowPtr = w; - return CAST(my->Buf, IPTR); + return (IPTR) my->Buf; } GERR(tr(S_UNER)); @@ -1054,24 +1051,24 @@ MUIDSP IGAskFile(Class *cls, Object *obj, struct MUIP_IG_AskFile *msg) if(rc == G_TRUE) { // Get filename from requester. - get(str, MUIA_String_Contents, CAST(msg->File, char **)); + get(str, MUIA_String_Contents, &msg->File); - if(*CAST(msg->File, char **)) + if(*((char **) msg->File)) { // We need to create a copy of the filename string since // we're about to free the pop up requester. int n = snprintf(my->Buf, sizeof(my->Buf), "%s", - *CAST(msg->File, char **)); + *((char **) msg->File)); // Make sure that we succeded in creating a copy of the // filename. if(n >= 0 && ((size_t) n < sizeof(my->Buf))) { - *CAST(msg->File, char **) = my->Buf; + *((char **) msg->File) = my->Buf; } } - if(!*CAST(msg->File, char **)) + if(!*((char **) msg->File)) { // Unknown error. GERR(tr(S_UNER)); @@ -1126,7 +1123,7 @@ MUIDSP IGCopyFilesStart(Class *cls, Object *obj, struct IGData *my = INST_DATA(cls, obj); int n = 0; - pnode_p cur = CAST(msg->List, pnode_p), lst = cur; + pnode_p cur = (pnode_p) msg->List, lst = cur; // For all files and directories to be copied; count the files, and if // confirmation is needed, add them to the selection / deselection list. @@ -1282,7 +1279,7 @@ MUIDSP IGCopyFilesSetCur(Class *cls, Object *obj, if(msg->File) { struct IGData *my = INST_DATA(cls, obj); - char *file = CAST(msg->File, char *); + char *file = (char *) msg->File; size_t len = strlen(file); struct TextExtent ext; static IPTR back; @@ -1852,7 +1849,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) if(mid + MUIA_IG_MediaBase <= MUIA_IG_MediaMax && msg->Media) { // And we need permission to read from the file. - BPTR flk = Lock(CAST(msg->Media, STRPTR), ACCESS_READ); + BPTR flk = Lock((STRPTR) msg->Media, ACCESS_READ); if(flk) { @@ -1877,7 +1874,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) msg->Media, msg->Action); // Return current media ID. - *CAST(msg->MediaID, int32_t *) = mid; + *((int32_t *) msg->MediaID) = mid; // Next ID. mid++; @@ -2017,7 +2014,7 @@ MUIDSP IGRadio(Class *cls, Object *obj, struct MUIP_IG_Radio *msg) if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, msg->Help, P_MESSAGE, B_PROCEED_ABORT)) { - char **nms = CAST(msg->Names, char **); + char **nms = (char **) msg->Names; if(nms && *nms) { @@ -2086,7 +2083,7 @@ MUIDSP IGRadio(Class *cls, Object *obj, struct MUIP_IG_Radio *msg) // Get value from buttons and then kill them. // A halt above will not make any difference. #ifndef __VBCC__ - GetAttr(MUIA_Radio_Active, r, CAST(msg->Select, IPTR *)); + GetAttr(MUIA_Radio_Active, r, (IPTR *) msg->Select); #endif MUI_DisposeObject(r); @@ -2196,7 +2193,7 @@ MUIDSP IGString(Class *cls, Object *obj, struct MUIP_IG_String *msg) } // No matter what, get string. - get(my->String, MUIA_String_Contents, CAST(msg->String, IPTR *)); + get(my->String, MUIA_String_Contents, (IPTR *) msg->String); // Return status. return rc; @@ -2253,7 +2250,7 @@ MUIDSP IGNumber(Class *cls, Object *obj, struct MUIP_IG_Number *msg) } // No matter what, get numerical value. - get(my->Number, MUIA_Numeric_Value, CAST(msg->Number, IPTR *)); + get(my->Number, MUIA_Numeric_Value, (IPTR *) msg->Number); // Success or halt. return rc; @@ -2288,7 +2285,7 @@ MUIDSP IGCheckBoxes(Class *cls, Object *obj, { size_t i = 0; static Object *cb[33]; - char **cs = CAST(msg->Names, char **); + char **cs = (char **) msg->Names; // Use 'Abort' or 'Back'? if(msg->Back) @@ -2367,14 +2364,14 @@ MUIDSP IGCheckBoxes(Class *cls, Object *obj, if(DoMethod(my->Empty, MUIM_Group_InitChange)) { // The return value. - *CAST(msg->Bitmap, IPTR *) = 0; + *((IPTR *) msg->Bitmap) = 0; while(i--) { IPTR sel = 0; get(cb[i], MUIA_Selected, &sel); - *CAST(msg->Bitmap, IPTR *) |= (sel ? (1 << i) : 0); + *((IPTR *) msg->Bitmap) |= (sel ? (1 << i) : 0); DoMethod(my->Empty, OM_REMMEMBER, cb[i]); MUI_DisposeObject(cb[i]); } @@ -2438,13 +2435,13 @@ MUIDSP IGConfirm(Class *cls, Object *obj, struct MUIP_IG_Confirm *msg) get(my->Text, MUIA_Text_Contents, &str)) { // Allocate memory to hold a copy of the current message. - size_t osz = strlen(CAST(str, char *)) + 1; + size_t osz = strlen((char *) str) + 1; char *ost = calloc(osz, 1); if(ost) { // Copy the current message. - memcpy(ost, CAST(str, char *), osz); + memcpy(ost, (char *) str, osz); // Prompt for confirmation. if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, msg->Help, From 89e1b913e51f694a30f7f4a74cda505bb66e914c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sat, 20 Jun 2020 21:46:57 +0200 Subject: [PATCH 16/20] 64-bit fixes. --- src/args.c | 12 +++++++++++- src/gui.c | 56 ++++++++++++++++++++++++++---------------------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/args.c b/src/args.c index d1f8bec1..8c015cc4 100644 --- a/src/args.c +++ b/src/args.c @@ -96,9 +96,19 @@ static bool arg_cli(int argc, char **argv) (void) argc; (void) argv; + // Hack to get around ReadArgs overwriting dir names. Should be fixed. + char *old = args[ARG_OLDDIR], *home = args[ARG_HOMEDIR]; + args[ARG_HOMEDIR] = args[ARG_OLDDIR] = NULL; + // Use the builtin commandline parser. - struct RDArgs *rda = (struct RDArgs *) ReadArgs(tr(S_ARGS), (IPTR *) args, + struct RDArgs *rda = (struct RDArgs *) ReadArgs(tr(S_ARGS), (LONG *) args, NULL); + // Copy booleans and restore dir names. See above. + args[ARG_NOPRETEND] = args[ARG_HOMEDIR]; + args[ARG_NOLOG] = args[ARG_OLDDIR]; + args[ARG_HOMEDIR] = home; + args[ARG_OLDDIR] = old; + if(!rda) { // Invalid or missing arguments. diff --git a/src/gui.c b/src/gui.c index 8ba1fd40..f8ebe5d5 100644 --- a/src/gui.c +++ b/src/gui.c @@ -44,7 +44,6 @@ #ifndef __GNUC__ #define __attribute__(a) -typedef LONG IPTR; #endif #if defined(AMIGA) && !defined(LG_TEST) @@ -828,11 +827,11 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) // Take minimum user level into account. set(my->ExpertLevel, MUIA_Radio_Active, - msg->Level - 1); + *((int32_t *) msg->Level) - 1); } // Set the current user level. - set(my->UserLevel, MUIA_Radio_Active, msg->Level); + set(my->UserLevel, MUIA_Radio_Active, *((int32_t *) msg->Level)); // Wait for proceed or abort. inp_t rc = IGTrans(IGWait(obj, MUIV_IG_Proceed, 2)); @@ -846,14 +845,13 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) if(msg->MinLevel == 1) { // Minimum user level 'average'. - get(my->ExpertLevel, MUIA_Radio_Active, &msg->Level); - msg->Level++; + get(my->ExpertLevel, MUIA_Radio_Active, (int32_t *) msg->Level); + (*((int32_t *) msg->Level))++; } else { // Minimum user level 'novice' or 'expert'. - get(my->UserLevel, MUIA_Radio_Active, - &msg->Level); + get(my->UserLevel, MUIA_Radio_Active, (int32_t *) msg->Level); } // Disable the pretend choice if the NOPRETEND tooltype is used. The @@ -862,7 +860,7 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) ( my->Pretend, MUIA_Radio_Active, - msg->NoPretend ? 0 : msg->Pretend, + msg->NoPretend ? 0 : *((int32_t *) msg->Pretend), MUIA_Disabled, msg->NoPretend ? TRUE : FALSE, TAG_END ); @@ -873,13 +871,13 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) ( my->Log, MUIA_Radio_Active, - msg->NoLog ? 0 : msg->Log, + msg->NoLog ? 0 : *((int32_t *) msg->Log), MUIA_Disabled, msg->NoLog ? TRUE : FALSE, TAG_END ); // Don't show logging and pretend mode settings to 'Novice' users. - if(msg->Level) + if(*((int32_t *) msg->Level)) { // Show pretend / log page. if(DoMethod(obj, MUIM_IG_PageSet, NULL, @@ -891,10 +889,9 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) if(rc == G_TRUE) { // Get pretend and log settings. - get(my->Pretend, MUIA_Radio_Active, - &msg->Pretend); - get(my->Log, MUIA_Radio_Active, - &msg->Log); + get(my->Log, MUIA_Radio_Active, (int32_t *) msg->Log); + get(my->Pretend, MUIA_Radio_Active, (int32_t *) + msg->Pretend); } } else @@ -1051,7 +1048,7 @@ MUIDSP IGAskFile(Class *cls, Object *obj, struct MUIP_IG_AskFile *msg) if(rc == G_TRUE) { // Get filename from requester. - get(str, MUIA_String_Contents, &msg->File); + get(str, MUIA_String_Contents, (char **) msg->File); if(*((char **) msg->File)) { @@ -1489,7 +1486,7 @@ MUIDSP IGEffect(Class *cls, Object *obj, struct MUIP_IG_Effect *msg) if(s) { // Allocate color vector. - IPTR *cv = calloc(s * 3, sizeof(IPTR)); + ULONG *cv = calloc(s * 3, sizeof(ULONG)); // Release pen and bail on OOM. if(!cv) @@ -1507,9 +1504,9 @@ MUIDSP IGEffect(Class *cls, Object *obj, struct MUIP_IG_Effect *msg) // Compute gradient. while(i < s * 3) { - cv[i++] = ((IPTR) r) << 24; - cv[i++] = ((IPTR) g) << 24; - cv[i++] = ((IPTR) b) << 24; + cv[i++] = ((ULONG) r) << 24; + cv[i++] = ((ULONG) g) << 24; + cv[i++] = ((ULONG) b) << 24; r += rd; g += gd; b += bd; @@ -1860,7 +1857,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) { // Get group ID of datatype. struct DataTypeHeader *dth = dtp->dtn_Header; - IPTR gid = dth->dth_GroupID; + ULONG gid = dth->dth_GroupID; // Free datatype resources and release lock. ReleaseDataType(dtp); @@ -1920,7 +1917,7 @@ MUIDSP IGShowMedia(Class *cls, Object *obj, struct MUIP_IG_ShowMedia *msg) MUIDSP IGMessage(Class *cls, Object *obj, struct MUIP_IG_Message *msg) { // Set correct page and button combination. - if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, NULL, 4/*P_MESSAGE*/, + if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, NULL, P_MESSAGE, B_PROCEED_ABORT)) { struct IGData *my = INST_DATA(cls, obj); @@ -2082,9 +2079,10 @@ MUIDSP IGRadio(Class *cls, Object *obj, struct MUIP_IG_Radio *msg) // Get value from buttons and then kill them. // A halt above will not make any difference. -#ifndef __VBCC__ +//#ifndef __VBCC__ + //.OS.TEST --> byt mot get? GetAttr(MUIA_Radio_Active, r, (IPTR *) msg->Select); -#endif +//#endif MUI_DisposeObject(r); // Unknown status. @@ -2193,7 +2191,7 @@ MUIDSP IGString(Class *cls, Object *obj, struct MUIP_IG_String *msg) } // No matter what, get string. - get(my->String, MUIA_String_Contents, (IPTR *) msg->String); + get(my->String, MUIA_String_Contents, (char **) msg->String); // Return status. return rc; @@ -2250,7 +2248,7 @@ MUIDSP IGNumber(Class *cls, Object *obj, struct MUIP_IG_Number *msg) } // No matter what, get numerical value. - get(my->Number, MUIA_Numeric_Value, (IPTR *) msg->Number); + get(my->Number, MUIA_Numeric_Value, (int32_t *) msg->Number); // Success or halt. return rc; @@ -2364,14 +2362,14 @@ MUIDSP IGCheckBoxes(Class *cls, Object *obj, if(DoMethod(my->Empty, MUIM_Group_InitChange)) { // The return value. - *((IPTR *) msg->Bitmap) = 0; + *((int32_t *) msg->Bitmap) = 0; while(i--) { - IPTR sel = 0; + ULONG sel = 0; get(cb[i], MUIA_Selected, &sel); - *((IPTR *) msg->Bitmap) |= (sel ? (1 << i) : 0); + *((int32_t *) msg->Bitmap) |= (sel ? (1 << i) : 0); DoMethod(my->Empty, OM_REMMEMBER, cb[i]); MUI_DisposeObject(cb[i]); } @@ -2426,7 +2424,7 @@ MUIDSP IGComplete(Class *cls, Object *obj, struct MUIP_IG_Complete *msg) MUIDSP IGConfirm(Class *cls, Object *obj, struct MUIP_IG_Confirm *msg) { struct IGData *my = INST_DATA(cls, obj); - IPTR top = 0, btm = 0, str = 0; + ULONG top = 0, btm = 0, str = 0; // Save the current state of whatever we're showing before we ask for // confirmation. From ab40376f89159f5473fdba3f579515288207e40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sun, 21 Jun 2020 21:12:44 +0200 Subject: [PATCH 17/20] Clean up. --- src/gui.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/gui.c b/src/gui.c index f8ebe5d5..92f59e7d 100644 --- a/src/gui.c +++ b/src/gui.c @@ -713,8 +713,7 @@ MUIDSP IGPageSet(Class *cls, Object *obj, struct MUIP_IG_PageSet *msg) struct IGData *my = INST_DATA(cls, obj); // Always a valid message string. - const char *src = msg->Message ? (const char *) - msg->Message : ""; + const char *src = msg->Message ? (const char *) msg->Message : ""; // Select top and buttons. set(my->Top, MUIA_Group_ActivePage, msg->Top); @@ -841,7 +840,6 @@ MUIDSP IGWelcome(Class *cls, Object *obj, struct MUIP_IG_Welcome *msg) // Get the selected user level value. If we have a minimum user // level of 'average' we're using a different set of radio buttons. // Fetch from the right object and adjust the return value. - // if(msg->MinLevel == 1) { // Minimum user level 'average'. @@ -2077,12 +2075,9 @@ MUIDSP IGRadio(Class *cls, Object *obj, struct MUIP_IG_Radio *msg) // We're done removing things. DoMethod(my->Empty, MUIM_Group_ExitChange); - // Get value from buttons and then kill them. - // A halt above will not make any difference. -//#ifndef __VBCC__ - //.OS.TEST --> byt mot get? - GetAttr(MUIA_Radio_Active, r, (IPTR *) msg->Select); -//#endif + // Get value from buttons and then kill them. A halt + // above will not make any difference. + get(r, MUIA_Radio_Active, (int32_t *) msg->Select); MUI_DisposeObject(r); // Unknown status. @@ -2269,16 +2264,14 @@ MUIDSP IGNumber(Class *cls, Object *obj, struct MUIP_IG_Number *msg) // Bitmap - A bitmask representing the selected button(s) // Return: G_TRUE / G_ABORT / G_EXIT / G_ERR //------------------------------------------------------------------------------ -MUIDSP IGCheckBoxes(Class *cls, Object *obj, - struct MUIP_IG_CheckBoxes *msg) +MUIDSP IGCheckBoxes(Class *cls, Object *obj, struct MUIP_IG_CheckBoxes *msg) { if(DoMethod(obj, MUIM_IG_PageSet, msg->Message, msg->Help, P_MESSAGE, B_PROCEED_ABORT)) { struct IGData *my = INST_DATA(cls, obj); - // Unlike most other pages, this one is partly generated on the fly, we - // have no choice. + // We have no choice but to generate this page on the fly, if(DoMethod(my->Empty, MUIM_Group_InitChange)) { size_t i = 0; From ecb926124fe5a62ed35f4f660702fb8415178f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sun, 21 Jun 2020 21:38:11 +0200 Subject: [PATCH 18/20] Status update. --- dist/InstallerLG.guide | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/InstallerLG.guide b/dist/InstallerLG.guide index a32dd205..a078a693 100644 --- a/dist/InstallerLG.guide +++ b/dist/InstallerLG.guide @@ -119,6 +119,8 @@ Italian translations. @{B}-----------------------------------------------------------------------@{UB} @{B}0.1.0-alpha.48 (2020-NOT-YET)@{UB} +- Everything is now 64-bit clean and runs on AxRT. +- Fixed NOLOG and NOPRETEND commandline arguments. - ? @{B}0.1.0-alpha.47 (2020-05-17)@{UB} From dd0621e6c0d4fd93f4f47de983e01fbe32e823d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Sun, 21 Jun 2020 21:52:51 +0200 Subject: [PATCH 19/20] Makefile clean up. --- build/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/Makefile b/build/Makefile index cf2c199f..03e4d8af 100644 --- a/build/Makefile +++ b/build/Makefile @@ -18,24 +18,22 @@ endif #---------------------------------------------------------------------------------# # OS #---------------------------------------------------------------------------------# -ifeq ($(OS),Linux) CWRN = -Wall -Wextra -Werror +ifeq ($(OS),Linux) CGEN = -g -std=c99 CDEF = -D_DEFAULT_SOURCE -D_GNU_SOURCE else ifeq ($(OS),Darwin) CGEN = -g -std=c99 -CWRN += -Werror -Weverything -Wno-format-nonliteral -Wno-padded else ifeq ($(OS),Windows_NT) CC = x86_64-w64-mingw32-gcc.exe -CWRN = -Wall -Wextra -Werror CGEN = -g -std=c99 CDEF = -D_DEFAULT_SOURCE -D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO else CC ?= gcc AMIGA = true -CWRN = -Wall -Wextra -Wno-pointer-sign +CWRN += -Wno-pointer-sign CGEN = -Os -std=gnu99 -DAMIGA LDLIBS = -ldebug ifeq ($(OS),MorphOS) From 3f66a5be21560affd7da5230b454b3ea47b2ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ola=20S=C3=B6der?= Date: Mon, 22 Jun 2020 15:23:51 +0200 Subject: [PATCH 20/20] Yepah! --- src/args.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/args.c b/src/args.c index 41750d77..8c015cc4 100644 --- a/src/args.c +++ b/src/args.c @@ -96,13 +96,10 @@ static bool arg_cli(int argc, char **argv) (void) argc; (void) argv; -<<<<<<< HEAD -======= // Hack to get around ReadArgs overwriting dir names. Should be fixed. char *old = args[ARG_OLDDIR], *home = args[ARG_HOMEDIR]; args[ARG_HOMEDIR] = args[ARG_OLDDIR] = NULL; ->>>>>>> axrt_test // Use the builtin commandline parser. struct RDArgs *rda = (struct RDArgs *) ReadArgs(tr(S_ARGS), (LONG *) args, NULL);