Changes made in GCCSDK for CVS

Peter Naulls peter at chocky.org
Tue Oct 15 07:26:49 PDT 2002


In message <4f317c854b.Jo at hobbes.riscos.be>
          John Tytgat <John.Tytgat at aaug.net> wrote:

>   __RISCOSIFY_FILETYPE_NOTFOUND.
>   [ So Peter, when you say "If the existing object file is typed data, sftype
>     ends up being fff", that doesn't sound right to me.  It should be -1
>     (== __RISCOSIFY_FILETYPE_NOTFOUND) when __RISCOSIFY_FILETYPE_SET is
>     set, or 0xFFD when __RISCOSIFY_FILETYPE_SET is unset. ]

Ah, that's correct for a plain filename, but if it's file.o, it goes
wrong.  However, I claim full responsibility.  If the MimeMap SWI fails
(as it will for .o), then the filetype is set to fff, which might seem
reasonable at first, but isn't actually correct.


Here's the fix:

Index: unixlib/source/common/riscosify.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/common/riscosify.c,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 riscosify.c
--- unixlib/source/common/riscosify.c	24 Sep 2002 11:29:18 -0000	1.2.2.5
+++ unixlib/source/common/riscosify.c	15 Oct 2002 14:25:50 -0000
@@ -943,10 +943,10 @@
           regs.r[1] = (int)last_dot;
           regs.r[2] = MMM_TYPE_RISCOS; /* Output filetype */
 
-          if (_kernel_swi(MimeMap_Translate, &regs, &regs)) {
-            /* Default to text if there's an error */
-            *filetype = 0xFFF;
-          } else {
+          /* If there's an error, then filetype will remain
+             __RISCOSIFY_FILETYPE_NOTFOUND */
+
+          if (!_kernel_swi(MimeMap_Translate, &regs, &regs)) {
             *filetype = regs.r[3];
           }
         }


-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 Homepage                     -  http://www.chocky.org/
 RISC OS C Programming        -  http://www.riscos.info/
 Unix Programs on RISC OS     -  http://www.chocky.org/unix/
------------------------------------------------------------------------
Free RISC OS Hosting - http://www.prowl.org/



More information about the gcc mailing list