• fastlst compilation err

    From Torsten Bamberg@2:240/5832 to Alle on Wednesday, July 08, 2015 00:31:20
    Hallo Alle!

    Does anybody has a idea whats going wrong? Well I'm absolutely clueless...

    -+- Anfang compile.log -+-
    dosfind.cc || echo './'`dosfind.cc
    dosfind.cc: In function `void Dos2My(FLFFIND*)':
    dosfind.cc:105: error: 'struct FLFFIND' has no member named 'longname' dosfind.cc:114: error: 'struct FLFFIND' has no member named 'longname' dosfind.cc:115: error: 'struct FLFFIND' has no member named 'longname' dosfind.cc:122: error: 'struct FLFFIND' has no member named 'longname' dosfind.cc: In function `unsigned int _DosFindFirst(const char*, unsigned int,
    FLFFIND*)':
    dosfind.cc:264: error: invalid conversion from `const char*' to `const unsigned
    char*'
    make.exe[3]: *** [dosfind.o] Error 1
    make.exe[3]: Leaving directory `E:/GCC/gcc3/dev/husky_06_2015/husky/fastlst/aplibs'
    make: *** [all] Error 2
    -+- Ende compile.log -+-


    -+- Anfang dosfind.cc -+-
    #include "apgenlib.hpp"

    #define EA_LONGNAME ".LONGNAME"


    #ifdef __OS2__

    #pragma pack(1)

    struct FILEFINDBUF3NONAME {
    ULONG oNextEntryOffset; /* new field */
    FDATE fdateCreation;
    FTIME ftimeCreation;
    FDATE fdateLastAccess;
    FTIME ftimeLastAccess;
    FDATE fdateLastWrite;
    FTIME ftimeLastWrite;
    ULONG cbFile;
    ULONG cbFileAlloc;
    ULONG attrFile; /* widened field */
    };

    struct FILEFINDEABUF {
    EAOP2 eaop2;
    FILEFINDBUF3NONAME ffb3;
    FEA2LIST fea2list; // followed by name and value of EA;
    byte buffer[3 * _MAX_PATH]; // On dword boundary, cbName (byte) and achName
    };


    // for ffind.flags
    #define FF_LONGNAME 0x01


    #define DwordBound(p) pvoid ((dword(p)+3) & 0xFFFFFFFC)

    #endif


    void Dos2My (FLFFIND *buf)
    {

    #if defined (__OS2__)

    FILEFINDBUF3NONAME *ffb3nn = (buf->flags & FF_LONGNAME) ?
    &buf->ffeab->ffb3 :
    (FILEFINDBUF3NONAME *)buf->ffb3;

    buf->attrib = (char) ffb3nn->attrFile;
    buf->cr_time = MKushort (ffb3nn->ftimeCreation);
    buf->cr_date = MKushort (ffb3nn->fdateCreation);
    buf->ac_time = MKushort (ffb3nn->ftimeLastAccess);
    buf->ac_date = MKushort (ffb3nn->fdateLastAccess);
    buf->wr_time = MKushort (ffb3nn->ftimeLastWrite);
    buf->wr_date = MKushort (ffb3nn->fdateLastWrite);
    buf->size = ffb3nn->cbFile;

    if (buf->flags & FF_LONGNAME) {

    PFEA2 fea2 = &buf->ffeab->fea2list.list[0];

    byte *p = (byte *) DwordBound (
    fea2->szName + // end of FEA2
    fea2->cbName + // length of EA name
    1 + // NULL terminator
    fea2->cbValue // length of EA value
    ); // points to cbName of file

    int filenamelen = *p;
    buf->name = (char *)(p+1);
    buf->name[filenamelen] = '\0'; // just make sure...

    buf->longname = NULL;
    if (fea2->cbValue != 0) {
    byte *p = (byte *)fea2->szName + fea2->cbName + 1;
    word eatype = *(word *)p;
    if (eatype == EAT_ASCII) {
    p += 2;
    word ealen = *(word *)p;
    if ((4 + ealen) <= fea2->cbValue) {
    p += 2;
    buf->longname = (char *)p;
    buf->longname[ealen] = '\0'; // may overwrite cbName
    }
    }
    }

    } else {
    buf->name = buf->ffb3->achName;
    buf->longname = NULL;
    }

    #elif defined (__NT__)

    PWIN32_FIND_DATA ff = buf->ff;

    buf->attrib = (byte)ff->dwFileAttributes;

    FiletimeUtc2Dosdatime (&ff->ftCreationTime, &buf->cr_date, &buf->cr_time);
    FiletimeUtc2Dosdatime (&ff->ftLastAccessTime, &buf->ac_date, &buf->ac_time);
    FiletimeUtc2Dosdatime (&ff->ftLastWriteTime, &buf->wr_date, &buf->wr_time);

    buf->size = ff->nFileSizeLow;
    buf->name = ff->cFileName;

    #elif defined (__linux__) || defined(UNIX)
    #else

    find_t *ff = buf->ff;
    buf->attrib = ff->attrib;
    buf->cr_time = 0;
    buf->cr_date = 0;
    buf->ac_time = 0;
    buf->ac_date = 0;
    buf->wr_time = ff->wr_time;
    buf->wr_date = ff->wr_date;
    buf->size = ff->size;
    buf->name = ff->name;

    #endif
    [....]
    -+- Ende dosfind.cc -+-



    Bye/2 Torsten

    ... MAILBOX02: Up 04d 11h 23m (BTUp2V1.5)
    --- GoldED+/EMX 1.1.4.7
    * Origin: DatenBahn BBS (2:240/5832)
  • From Markus Reschke@2:240/1661 to Torsten Bamberg on Wednesday, July 08, 2015 18:22:42
    Hi Torsten!

    Jul 08 00:31 2015, Torsten Bamberg wrote to Alle:


    Does anybody has a idea whats going wrong? Well I'm absolutely clueless...

    -+- Anfang compile.log -+-
    dosfind.cc || echo './'`dosfind.cc
    dosfind.cc: In function `void Dos2My(FLFFIND*)':
    dosfind.cc:105: error: 'struct FLFFIND' has no member named
    'longname'

    Look for structure FLFFIND and add:
    char *longname;

    This is what the compiler told you ;)

    Regards,
    Markus

    ---
    * Origin: *** theca tabellaria *** (2:240/1661)
  • From mark lewis@1:3634/12.73 to Markus Reschke on Wednesday, July 08, 2015 14:37:04

    08 Jul 15 18:22, you wrote to Torsten Bamberg:

    Does anybody has a idea whats going wrong? Well I'm absolutely
    clueless...

    -+- Anfang compile.log -+-
    dosfind.cc || echo './'`dosfind.cc
    dosfind.cc: In function `void Dos2My(FLFFIND*)':
    dosfind.cc:105: error: 'struct FLFFIND' has no member named
    'longname'

    Look for structure FLFFIND and add:
    char *longname;

    This is what the compiler told you ;)

    any idea when this will be fixed in the repository?

    )\/(ark

    ... If money is the root of all evil, why do churches seek it so avidly?
    ---
    * Origin: (1:3634/12.73)
  • From Torsten Bamberg@2:240/5832 to Markus Reschke on Wednesday, July 08, 2015 23:51:22
    Hallo Markus!

    Mittwoch, den 08. Juli 2015 18:22, Markus Reschke schrieb an Torsten Bamberg:

    dosfind.cc:105: error: 'struct FLFFIND' has no member named
    'longname'

    Look for structure FLFFIND and add:
    char *longname;
    This is what the compiler told you ;)
    Aehm, thanks a lot. :-)
    At this point it's getting strange:
    BTW: I compared the sourcetree with the first availeble dosfind.cc on sourceforge, and there are the same lines as shown underneath.
    Probably it is a very old fault, because fastlst2.03 was never compiled for os/2 with emx-gcc. And I'm not used to write c++.

    -+- Anfang compile.log -+-
    dosfind.cc: In function `unsigned int _DosFindFirst(const char*, unsigned int,
    FLFFIND*)':
    dosfind.cc:264: error: invalid conversion from `const char*' to `const unsigned
    char*'
    -+- Ende compile.log -+-


    -+- Anfang dosfind.cc -+-

    void Dos2My (FLFFIND *buf)
    {
    #if defined (__OS2__)
    [...]

    unsigned _DosFindFirst (pcsz path, unsigned attributes, FLFFIND *buffer)
    {
    SetAttrMask (attributes, buffer);

    #if defined (__OS2__)

    if (buffer->flags & FF_LONGNAME) {
    int fst = QueryFS (path);
    if ((fst != QFS_FAT) && (fst != QFS_NET_EA))
    buffer->flags &= ~FF_LONGNAME;
    }

    if (buffer->flags & FF_LONGNAME) {
    buffer->bufsize = sizeof (FILEFINDEABUF);
    buffer->infolevel = FIL_QUERYEASFROMLIST;
    buffer->ffeab = new FILEFINDEABUF;
    } else {
    buffer->bufsize = sizeof (FILEFINDBUF3);
    buffer->infolevel = FIL_STANDARD;
    buffer->ffb3 = new FILEFINDBUF3;
    }

    if (buffer->flags & FF_LONGNAME) { // setup the EAOP2
    PEAOP2 eaop2 = &buffer->ffeab->eaop2;
    int eanamelen = strlen (EA_LONGNAME);
    int gea2listsize = sizeof (GEA2LIST) + eanamelen;
    eaop2->fpGEA2List = (PGEA2LIST) new byte[gea2listsize];
    eaop2->fpFEA2List = NULL;
    eaop2->fpGEA2List->cbList = gea2listsize;
    eaop2->fpGEA2List->list[0].oNextEntryOffset = 0;
    eaop2->fpGEA2List->list[0].cbName = eanamelen;
    strcpy (eaop2->fpGEA2List->list[0].szName, EA_LONGNAME);
    }

    ULONG FindCount = 1;
    buffer->DirHandle = HDIR_CREATE;
    if (DosFindFirst (path, &buffer->DirHandle,
    FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY,
    buffer->ff, buffer->bufsize, &FindCount, buffer->infolevel))

    #elif defined (__NT__)
    [...]
    -+- Ende dosfind.cc -+-

    Regards,
    Markus
    Bye/2 Torsten

    ... MAILBOX02: Up 05d 10h 43m (BTUp2V1.5)
    --- GoldED+/EMX 1.1.4.7
    * Origin: DatenBahn BBS (2:240/5832)
  • From Markus Reschke@2:240/1661 to Torsten Bamberg on Thursday, July 09, 2015 00:20:20
    Hi Torsten!

    Jul 08 23:51 2015, Torsten Bamberg wrote to Markus Reschke:

    -+- Anfang compile.log -+-
    dosfind.cc: In function `unsigned int _DosFindFirst(const char*,
    unsigned int, FLFFIND*)':
    dosfind.cc:264: error: invalid conversion from `const char*' to
    `const unsigned char*'
    -+- Ende compile.log -+-

    This looks like the compiler is called with some sort of "strict mode" option.

    Solution #1: disable the "strict mode"

    Solution #2: make the variables the same type (could take some effort)

    Solution #3: type conversion (quick fix)
    If you need a "const unsigned char*", but your variable Var is a "const char*",
    perform a type conversion to make the compiler happy:
    (const unsigned char*)Var

    Regards,
    Markus

    ---
    * Origin: *** theca tabellaria *** (2:240/1661)
  • From Markus Reschke@2:240/1661 to mark lewis on Thursday, July 09, 2015 00:35:20
    Hello Mark!

    Jul 08 14:37 2015, mark lewis wrote to Markus Reschke:

    Look for structure FLFFIND and add:
    char *longname;

    This is what the compiler told you ;)

    any idea when this will be fixed in the repository?

    Let's wait what else Torsten will find.

    Regards,
    Markus

    ---
    * Origin: *** theca tabellaria *** (2:240/1661)