1980s code, error E2293 ) expected, but can't see where there is a missing )

This is a discussion on 1980s code, error E2293 ) expected, but can't see where there is a missing ) within the C Programming forums, part of the General Programming Boards category; I have inherited some code that was first written in the mid 1980s, and last updated in 1993. It takes ...

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    1980s code, error E2293 ) expected, but can't see where there is a missing )

    I have inherited some code that was first written in the mid 1980s, and last updated in 1993.

    It takes a data file that our flagship program creates and plots it then prints out the plot. It's been great, and is a nice thing for our more frugal customers who don't want fancy graphics and are just wanting to give their customer a printout when the job is over. It's worked since DOS in all the versions of Windows we 're tried, till now.

    However, it does not work in Windows 7.

    And sadly, our customers want to run Windows 7. So...

    So it needs a re-write, or maybe we'll strip out the code that does the plotting and add it to our flagship program. I got handed the job. The guy that wrote it originally is no longer around.

    I figured, and perhaps this is wrong, that I should compile what's there, and then start looking at it and seeing what does what and what I need to change to get it to work in Windows 7.

    I am using Borland's bcc55 command line compiler because my boss is fairly sure that the guy that worked on it last used Borland's compiler, and this was free.

    I am getting some odd errors.

    In butil.h, line 397 I get an "error E2293 ) expected". But it's not. And there's not one missing above it. And then I get the same error on line 432. The code from 397 to 434 is this:

    Code:
    void cdecl utamove ((char far *),(char far *),(unsigned int),(int)); /* Copy memory from far pointer */            /*char far *,      source to far pointer target.*/
                /*unsigned int,   Does not handle overlap.     */
                /*int);        /*                    */
    
    
                // replaced with code from newer butil.h from 1988
    //void cdecl utamove(const char far *,/* Copy memory from far pointer */ 
    //            char far *,     /* source to far pointer target.*/ 
    //            unsigned int,   /* Does not handle overlap.     */ 
    //            int);        /*                    */ 
                        /*                    */ 
    
    
    
    
                        /*                    */
    int cdecl utctlbrk (int,int);        /* Set or return state of DOS   */
                        /* CTRL-BREAK checking.        */
                        /*                    */
    #ifndef utdosver            /*                    */
    int cdecl utdosver (void);        /* Return the DOS major, minor  */
    #endif                    /* version number as 16-bit.    */
                        /*                    */
    int cdecl utgetclk (long *);        /* Return the BIOS clock roll   */
                        /* flag and tick count.        */
                        /*                    */
    int cdecl utintflg (int);        /* Set interrupt state, return  */
                        /* old state.            */
                        /*                    */
    unsigned int cdecl utnulchk (void); /* Check for NIL-pointer        */
                        /* assignments.            */
                        /*                    */
    unsigned cdecl utsleep (unsigned);  /* Suspend processing for        */
                        /* specified duration.        */
                        /*                    */
    void cdecl utspkr (unsigned);        /* Speaker control.         */
                        /*                    */
    void cdecl utmovmem (char far *, char far *,unsigned int);   /* Copy block of memory, using  */
                 /*char far *,    /* far pointer source and        */
                 /*unsigned int); /* target.                */
    Any thoughts?

    I thought at first that it was something to do with the char far * as I am also getting the same error message in asych_1.h in lines 53 and 82, and the only common thing is that all of them are using far. Here's that code:

    Code:
    int cdecl iscom_a1(int,unsigned *,unsigned *,char far **);                       /* Open a COM port           */
    int cdecl open_a1(int,int,int,int,int,char *);
    int cdecl close_a1(int);           /* Close a COM port           */
                           /* Write a block            */
    int cdecl wrtbk_a1(int,int,char,char *,int *);
                           /* Write a string           */
    int cdecl wrtst_a1(int,int,char *,int *);
    int cdecl wrtch_a1(int,char);           /* Write a character           */
                           /* Read a character           */
    int cdecl rdch_a1(int,char *,int *,unsigned *);
                           /* Read a string            */
    int cdecl rdst_a1(int,int,char *,int *,int *,unsigned *);
                           /* Read a block               */
    int cdecl rdbk_a1(int,int,char,char *,int *,int *,unsigned *);
                           /* Return input queue size      */
    int cdecl qsize_a1(int,int *,unsigned *);
    int cdecl oqsiz_a1(int,int *);           /* Return output queue size     */
    int cdecl setop_a1(int,int,int);       /* Set transmission options     */
    int cdecl retop_a1(int,int,int *);     /* Return transmission options  */
    int cdecl oflsh_a1(int);           /* Flush the output queue       */
    int cdecl iflsh_a1(int);           /* Flush the input queue        */
    int cdecl break_a1(int);           /* Send a break signal           */
                           /* BIOS initialization of a port*/
    int cdecl init_a1(int,int,int,int,int,int *,int *);
    int cdecl stat_a1(int,int *,int *);    /* BIOS return of COM status    */
    int cdecl rcvch_a1(int,char *);        /* BIOS read a character        */
    int cdecl sndch_a1(int,char);           /* BIOS send a character        */
                           /* Return the busy flag           */
    int cdecl bflag_a1(int,int *,int far **);
    So I added

    Code:
    #ifdef FAR    #undef FAR
    #endif  /* end #ifdef FAR */
    // define FAR to be nothing just to satisfy the compiler
    #define FAR
    before the bits of code, thinking maybe it just didn't know what far was, but that didn't do a dang thing.

    So, any ideas?

    I have counted the number of open and close parenthesis multiple times and keep getting an even number, and can't see where there are any missing.

    Both butil.h and async_1 .h are from Blaise Computing Inc. in the mid 1980s. I was able to find a newer version of butil.h, but ran into the same problem with it.

    Any thoughts?

    I'm sure it's something easy, but I am having a bit of a brain fart, and it's been 12+ years since I did any C, so maybe that's just it.

    Any help at all is appreciated,

    Thanks,

    -Mike
    Last edited by gandalf23; 04-06-2012 at 01:40 PM.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,498
    You're on the right track, trying to get rid of far, but the preprocessor is case sensitive, just like the rest of C. Try
    Code:
    #define far
    The only reason most #defines are upper case is as a reminder when using them in code that they are preprocessor symbols and/or constants. It is not a requirement that all preprocessor symbols be upper case.

  3. #3
    Registered User
    Join Date
    Apr 2012
    Posts
    2
    aww, man!

    A co-worker even asked me if I was sure it was case insensitive, and I said "Yeah, I'm sure!"

    ugh.

    Oh well.

    Changed it, and now it works. Well, at least those errors are not there, there are other errors, but I think I can work through them

    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error: expected '(' before 'else'
    By BigWigly in forum C Programming
    Replies: 10
    Last Post: 03-11-2011, 04:35 PM
  2. error C2143: syntax error : missing ')' before ';'
    By steve1_rm in forum C Programming
    Replies: 4
    Last Post: 05-14-2008, 11:06 AM
  3. error: expected ')' before
    By AKeiTyrian in forum C Programming
    Replies: 7
    Last Post: 04-13-2008, 11:15 PM
  4. Expected error
    By ZakkWylde969 in forum C Programming
    Replies: 9
    Last Post: 06-17-2003, 10:51 AM
  5. Type name expected error
    By SilasP in forum C++ Programming
    Replies: 4
    Last Post: 12-09-2001, 01:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21