Ignore:
Timestamp:
11/07/14 17:51:01 (10 years ago)
Author:
Maciej Komosinski
Message:

Sources support both 32-bit and 64-bit, and more compilers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/virtfile/stringfile.cpp

    r207 r247  
    77#include <errno.h> //EINVAL
    88
    9 int StringFILE::Vread(void *ptr, size_t size, size_t nmemb)
     9size_t StringFILE::Vread(void *ptr, size_t size, size_t nmemb)
    1010{
    11 int have=str.len()-pos;
     11int have=(int)(str.len()-pos);
    1212if (have<=0) return 0;
    13 int need=size*nmemb;
    14 if (need>have) {nmemb=have/size; need=size*nmemb;}
     13int need=(int)(size*nmemb);
     14if (need>have) {nmemb=have/size; need=(int)(size*nmemb);}
    1515memcpy(ptr,((const char*)str)+pos,need);
    1616pos+=need;
     
    2323        return EOF;
    2424else
    25         return str[pos++];
     25        return str.operator[]((int)pos++);
    2626}
    2727
    2828char *StringFILE::Vgets(char *s, int size)
    2929{
    30 int have=str.len()-pos;
     30int have=str.len()-(int)pos;
    3131if (have<=0) return 0;
    3232if (size<0) size=0;
Note: See TracChangeset for help on using the changeset viewer.