src/file/SDL_rwops.c
branchSDL-1.2
changeset 4027 407ecf3ad3b3
parent 4026 255b0469ca83
child 4035 3ccd06fc22e5
equal deleted inserted replaced
4026:255b0469ca83 4027:407ecf3ad3b3
   185     if (total_need < READAHEAD_BUFFER_SIZE) {
   185     if (total_need < READAHEAD_BUFFER_SIZE) {
   186         if (!ReadFile(context->hidden.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) {
   186         if (!ReadFile(context->hidden.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) {
   187             SDL_Error(SDL_EFREAD);
   187             SDL_Error(SDL_EFREAD);
   188             return 0;
   188             return 0;
   189         }
   189         }
   190         read_ahead = SDL_min(total_need, byte_read);
   190         read_ahead = SDL_min(total_need, (int)byte_read);
   191         SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
   191         SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
   192         context->hidden.win32io.buffer.size = byte_read;
   192         context->hidden.win32io.buffer.size = byte_read;
   193         context->hidden.win32io.buffer.left = byte_read-read_ahead;
   193         context->hidden.win32io.buffer.left = byte_read-read_ahead;
   194         total_read += read_ahead;
   194         total_read += read_ahead;
   195     } else {
   195     } else {