Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!lll-lcc!mordor!berry@askone From: berry@askone (Berry Kercheval) Newsgroups: comp.graphics Subject: Re: Trying to get QRT working... Message-ID: <23934@mordor.s1.gov> Date: 28 Feb 89 19:47:03 GMT References: <10469@pasteur.Berkeley.EDU> Sender: news@mordor.s1.gov Reply-To: berry@askone (Berry Kercheval) Distribution: na Organization: Lawrence Livermore National Laboratory -- S1 Project Lines: 55 In-reply-to: labc-4dc@e260-4f.berkeley.edu (Erik Talvola) In article <10469@pasteur.Berkeley.EDU>, labc-4dc@e260-4f (Erik Talvola) writes: > >As soon as the QRT source was posted, I immediately compiled it on the >Sun 3/50 here at Berkeley. After adding a #include to lexer.c >to get toupper() defined, it compiled perfectly. However, I can't get >it to run on any of the sample files posted here. Here is what happens >if I try to execute the program on the table.qrt file: > Aha. Classic problem. The WRT source assume that you have a "safe" toupper(), that is, one that will not modify any characters that are not lower case letters. In other words, toupper('a') gives 'A', and toupper('A') also gives 'A'. Apply this patch to lexer.c: -----cut here---- *** lexer.c Tue Feb 28 11:41:58 1989 --- lexer.c.~1~ Thu Feb 16 07:41:51 1989 *************** *** 6,12 **** **********************************************************/ ! #include #include "qrt.h" extern int linenumber; --- 6,12 ---- **********************************************************/ ! #include "qrt.h" extern int linenumber; *************** *** 16,30 **** float atof(); # endif - #undef toupper - toupper(c) - int c; - { - if(islower(c)) - return ((c)-'a'+'A'); - else - return c; - } /********************************************************** Transforms all white spaces to blanks --- 16,21 ---- ------end of patch-------