sqFilenameFromString changes cause os-9 compile to fail.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sqFilenameFromString changes cause os-9 compile to fail.

johnmci
This macro was
#define sqFilenameFromString(dst, src, num) \
if (1) { \
        int i; \
        for (i = 0; i < num; i++) { \
                dst[i] = *((char *) (src + i)); \
        } \
        dst[num] = 0;\
}

that got changed to this

#define sqFilenameFromString(dst, src, num) \
   do { \
     int i; \
     for (i= 0;  i < num;  ++i) \
       (dst)[i]= (src)[i]; \
     dst[num]= '\0'; \
   } while(0)

however the old codewarrior compiler errors with
(dst)[i] = (src)[i]

pointer/array required

say in
sqInt sqFileDeleteNameSize(sqInt sqFileNameIndex, sqInt sqFileNameSize)  
{
        char cFileName[1000];

This is not a problem on OS-X because we override the  
sqFilenameFromString in order to convert the HFS+ file name to posix  
UTF-8 file names.
I'm wonder here if src which is sqFileNameIndex which define as sqInt  
which is int, then don't we really need proper casting here?


--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===