src/thread/SDL_thread.c
changeset 7482 249d8ecbbb7d
parent 7393 358696c354a8
child 7484 c6c4f8719af6
equal deleted inserted replaced
7481:5ff71e03d9eb 7482:249d8ecbbb7d
    55     if (id == 0) {
    55     if (id == 0) {
    56         return SDL_InvalidParamError("id");
    56         return SDL_InvalidParamError("id");
    57     }
    57     }
    58 
    58 
    59     storage = SDL_SYS_GetTLSData();
    59     storage = SDL_SYS_GetTLSData();
    60     if (!storage || id > storage->limit) {
    60     if (!storage || (id > storage->limit)) {
    61         int i, oldlimit, newlimit;
    61         unsigned int i, oldlimit, newlimit;
    62 
    62 
    63         oldlimit = storage ? storage->limit : 0;
    63         oldlimit = storage ? storage->limit : 0;
    64         newlimit = (id + TLS_ALLOC_CHUNKSIZE);
    64         newlimit = (id + TLS_ALLOC_CHUNKSIZE);
    65         storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage)+(newlimit-1)*sizeof(storage->array[0]));
    65         storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage)+(newlimit-1)*sizeof(storage->array[0]));
    66         if (!storage) {
    66         if (!storage) {