Changeset 888
- Timestamp:
- 07/22/19 01:15:38 (6 years ago)
- Location:
- cpp/common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_stdio.cpp
r878 r888 119 119 int getFileSize(MFILE *f) 120 120 { 121 int saved_pos = mftell(f);121 int saved_pos = (int)mftell(f); 122 122 mfseek(f, 0, SEEK_END); 123 int size = mftell(f);123 int size = (int)mftell(f); 124 124 mfseek(f, saved_pos, SEEK_SET); 125 125 return size; -
cpp/common/util-file.cpp
r840 r888 22 22 int size=f->getSize(); 23 23 data.resize(size); 24 int przeczytane = f->Vread(&data[0], size, 1);25 ok = przeczytane == 1;24 int przeczytane = (int)f->Vread(&data[0], size, 1); 25 ok = (przeczytane == 1); 26 26 delete f; 27 27 } … … 35 35 int size = getFileSize(f); 36 36 data.resize(size); 37 int przeczytane = mfread(&data[0], size, 1, f);37 int przeczytane = (int)mfread(&data[0], size, 1, f); 38 38 mfclose(f); 39 ok = przeczytane == 1;39 ok = (przeczytane == 1); 40 40 } 41 41 } … … 63 63 if (f) 64 64 { 65 int zapisane = f->Vwrite(text.c_str(), text.length(), 1);65 int zapisane = (int)f->Vwrite(text.c_str(), text.length(), 1); 66 66 delete f; 67 ok &= zapisane == 1;67 ok &= (zapisane == 1); 68 68 } 69 69 #else … … 72 72 if (f) 73 73 { 74 int zapisane = mfwrite(text.c_str(), text.length(), 1, f);74 int zapisane = (int)mfwrite(text.c_str(), text.length(), 1, f); 75 75 mfclose(f); 76 ok &= zapisane == 1;76 ok &= (zapisane == 1); 77 77 } 78 78 #endif -
cpp/common/util-stl.h
r840 r888 32 32 typename vector<T>::iterator it = find(v.begin(), v.end(), e); 33 33 if (it != v.end()) 34 return &*it - &v.front();34 return int(&*it - &v.front()); 35 35 return -1; 36 36 } … … 42 42 ~DeletingVector() 43 43 { 44 for (int i = vector.size() - 1; i >= 0; i--)44 for (int i = (int)vector.size() - 1; i >= 0; i--) 45 45 delete vector[i]; 46 46 } -
cpp/common/virtfile/virtfile.cpp
r841 r888 64 64 { 65 65 string s = ssprintf_va(format, args); 66 return Vwrite(s.c_str(), 1, s.size());66 return (int)Vwrite(s.c_str(), 1, s.size()); 67 67 } 68 68 … … 78 78 int VirtFILE::getSize() 79 79 { 80 intsaved_pos = Vtell();80 auto saved_pos = Vtell(); 81 81 Vseek(0, SEEK_END); 82 int size = Vtell();82 int size = (int)Vtell(); 83 83 Vseek(saved_pos, SEEK_SET); 84 84 return size; … … 104 104 105 105 106 int fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f) { return f->Vread(ptr, size, nmemb); }107 int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f) { return f->Vwrite(ptr, size, nmemb); }106 size_t fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f) { return f->Vread(ptr, size, nmemb); } 107 size_t fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f) { return f->Vwrite(ptr, size, nmemb); } 108 108 109 109 … … 132 132 int fgetc(VirtFILE* f) { return f->Vgetc(); } 133 133 int fseek(VirtFILE* f, long offset, int whence) { return f->Vseek(offset, whence); } 134 int ftell(VirtFILE* f) { return f->Vtell(); }134 int ftell(VirtFILE* f) { return (int)f->Vtell(); } 135 135 void rewind(VirtFILE* f) { f->Vrewind(); } 136 136 int fflush(VirtFILE* f) { return f->Vflush(); }
Note: See TracChangeset
for help on using the changeset viewer.