diff --git a/demos/shooter/demo.c b/demos/shooter/demo.c index bc07b80e9e..ea665664a3 100644 --- a/demos/shooter/demo.c +++ b/demos/shooter/demo.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) install_joystick(JOY_TYPE_NONE); } - if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) { + if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) { //GFX_AUTODETECT if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Unable to set any graphic mode\n%s\n", diff --git a/src/file.c b/src/file.c index c89024c14e..633478d86d 100644 --- a/src/file.c +++ b/src/file.c @@ -2065,7 +2065,7 @@ PACKFILE *pack_fopen_chunk(PACKFILE *f, int pack) return NULL; } _al_sane_strncpy(chunk->normal.passdata, f->normal.passdata, strlen(f->normal.passdata)+1); - chunk->normal.passpos = chunk->normal.passdata + (long)f->normal.passpos - (long)f->normal.passdata; + chunk->normal.passpos = chunk->normal.passdata + (ULONG_PTR)f->normal.passpos - (ULONG_PTR)f->normal.passdata; //64bit long f->normal.passpos = f->normal.passdata; } chunk->normal.flags |= PACKFILE_FLAG_OLD_CRYPT; @@ -2188,7 +2188,7 @@ PACKFILE *pack_fclose_chunk(PACKFILE *f) } if ((f->normal.passpos) && (f->normal.flags & PACKFILE_FLAG_OLD_CRYPT)) - parent->normal.passpos = parent->normal.passdata + (long)f->normal.passpos - (long)f->normal.passdata; + parent->normal.passpos = parent->normal.passdata + (ULONG_PTR)f->normal.passpos - (ULONG_PTR)f->normal.passdata; //64bit long free_packfile(f); } diff --git a/src/fsel.c b/src/fsel.c index 96fd796bc2..024d8823c3 100644 --- a/src/fsel.c +++ b/src/fsel.c @@ -933,7 +933,7 @@ int file_select_ex(AL_CONST char *message, char *path, AL_CONST char *ext, int s if (ugetc(get_filename(path))) { p = get_extension(path); if ((!ugetc(p)) && (ext) && (ugetc(ext)) && (!ustrpbrk(ext, uconvert_ascii(" ,;", tmp)))) { - size -= ((long)p - (long)path + ucwidth('.')); + size -= ((unsigned long long)p - (unsigned long long)path + ucwidth('.')); //64bit long if (size >= uwidth_max(U_CURRENT) + ucwidth(0)) { /* do not end with '.' */ p += usetc(p, '.'); ustrzcpy(p, size, ext); diff --git a/src/glyph.c b/src/glyph.c index b4ba535ceb..b92b6ba974 100644 --- a/src/glyph.c +++ b/src/glyph.c @@ -25,7 +25,7 @@ #define DRAW_GLYPH(bits, size) \ { \ AL_CONST unsigned char *data = glyph->dat; \ - unsigned long addr; \ + unsigned long long addr; \ int w = glyph->w; \ int h = glyph->h; \ int stride = (w+7)/8; \ @@ -183,7 +183,7 @@ void _linear_draw_glyph24(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, */ void _linear_draw_glyph32(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg) { - DRAW_GLYPH(32, sizeof(int32_t)); + DRAW_GLYPH(32, sizeof(int32_t)); //64bit int32_t } #endif diff --git a/src/gsprite.c b/src/gsprite.c index 1f0f606f3c..1cfd3c4c5b 100644 --- a/src/gsprite.c +++ b/src/gsprite.c @@ -139,7 +139,7 @@ void _soft_draw_gouraud_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y, int c1 addr = bmp_write_line(bmp, j) + x1*3; for (i=x1; iline[j-y] + (i-x)*3)); + pixel = bmp_read24((unsigned long long)(sprite->line[j-y] + (i-x)*3)); //64bit unsigned long bmp_select(bmp); if (pixel != MASK_COLOR_24) { pixel = _blender_func24(pixel, _blender_col_24, fixtoi(hc)); diff --git a/src/gui.c b/src/gui.c index dfe96f6169..c18dce6390 100644 --- a/src/gui.c +++ b/src/gui.c @@ -571,7 +571,7 @@ static int obj_list_cmp(AL_CONST void *e1, AL_CONST void *e2) */ static int cmp_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2) { - int ret = (int)((AL_CONST unsigned long)d2 - (AL_CONST unsigned long)d1); + int ret = (int)((AL_CONST unsigned long long)d2 - (AL_CONST unsigned long long)d1); //64bit unsigned long /* Wrap around if d2 is before d1 in the dialog array. */ if (ret < 0) @@ -587,7 +587,7 @@ static int cmp_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2) */ static int cmp_shift_tab(AL_CONST DIALOG *d1, AL_CONST DIALOG *d2) { - int ret = (int)((AL_CONST unsigned long)d1 - (AL_CONST unsigned long)d2); + int ret = (int)((AL_CONST unsigned long long)d1 - (AL_CONST unsigned long long)d2); //64bit unsigned long /* Wrap around if d2 is after d1 in the dialog array. */ if (ret < 0) diff --git a/src/guiproc.c b/src/guiproc.c index edd284a831..8acf28a975 100644 --- a/src/guiproc.c +++ b/src/guiproc.c @@ -1365,17 +1365,17 @@ int d_text_list_proc(int msg, DIALOG *d, int c) thisitem = (*(getfuncptr)d->dp)(i, NULL); failure = FALSE; - if ((int)((unsigned long)d->dp3) < ustrlen(thisitem)) { - for (a=0; a < (int)((unsigned long)d->dp3); a++) { + if ((int)((unsigned long long)d->dp3) < ustrlen(thisitem)) { + for (a=0; a < (int)((unsigned long long)d->dp3); a++) { //64bit unsigned long if (utolower(ugetat(thisitem, a)) != utolower(ugetat(selected, a))) { failure = TRUE; break; } } - if ((!failure) && (utolower(ugetat(thisitem, (int)(unsigned long)d->dp3)) == utolower(c))) { + if ((!failure) && (utolower(ugetat(thisitem, (int)(unsigned long long)d->dp3)) == utolower(c))) { d->d1 = i; - d->dp3 = (void *)((unsigned long)d->dp3 + 1); + d->dp3 = (void *)((unsigned long long)d->dp3 + 1); if (sel) { for (i=0; iid |= BMP_ID_LOCKED; /* update the line array if our parent has moved */ - pitch = (long)parent->line[1] - (long)parent->line[0]; + pitch = (long long)parent->line[1] - (long long)parent->line[0]; data = parent->line[0] + (bmp->y_ofs - parent->y_ofs) * pitch + (bmp->x_ofs - parent->x_ofs) * BYTES_PER_PIXEL(bitmap_color_depth(bmp)); @@ -263,7 +263,7 @@ void gfx_directx_autolock(BITMAP *bmp) } /* update the line array if our parent has moved */ - pitch = (long)parent->line[1] - (long)parent->line[0]; + pitch = (long long)parent->line[1] - (long long)parent->line[0]; data = parent->line[0] + (bmp->y_ofs - parent->y_ofs) * pitch + (bmp->x_ofs - parent->x_ofs) * BYTES_PER_PIXEL(bitmap_color_depth(bmp)); diff --git a/src/win/wgdi.c b/src/win/wgdi.c index 5d173a6897..5e79967a44 100644 --- a/src/win/wgdi.c +++ b/src/win/wgdi.c @@ -524,7 +524,7 @@ static struct BITMAP *gfx_gdi_init(int w, int h, int v_w, int v_h, int color_dep /* create the screen surface */ screen_surf = _AL_MALLOC_ATOMIC(w * h * BYTES_PER_PIXEL(color_depth)); - gdi_screen = _make_bitmap(w, h, (unsigned long)screen_surf, &gfx_gdi, color_depth, w * BYTES_PER_PIXEL(color_depth)); + gdi_screen = _make_bitmap(w, h, (unsigned long long)screen_surf, &gfx_gdi, color_depth, w * BYTES_PER_PIXEL(color_depth)); if (!gdi_screen) { _TRACE(PREFIX_E "Could not make a bitmap out of the screen surface.\n"); goto Error; diff --git a/src/win/wmidi.c b/src/win/wmidi.c index 89b253c6f2..22ea14a8e1 100644 --- a/src/win/wmidi.c +++ b/src/win/wmidi.c @@ -242,8 +242,8 @@ int midi_win32_in_init(int input, int voices) id = (midi_input_driver->id & 0xFF) - 'A'; /* open midi input device */ - hr = midiInOpen(&midi_in_device, id, (DWORD)midi_in_proc, - (DWORD)NULL, CALLBACK_FUNCTION); + hr = midiInOpen(&midi_in_device, id, (unsigned long long)midi_in_proc, + (unsigned long long)NULL, CALLBACK_FUNCTION); if (hr != MMSYSERR_NOERROR) { _TRACE(PREFIX_E "midiInOpen failed (%x)\n", hr); midi_win32_in_exit(input); diff --git a/src/win/wsndwo.c b/src/win/wsndwo.c index 439eb6c09c..436aceb696 100644 --- a/src/win/wsndwo.c +++ b/src/win/wsndwo.c @@ -212,7 +212,7 @@ static void digi_waveout_mixer_callback(void) if (++digiwobufpos > (digiwobufdivs-1)) digiwobufpos = 0; - _mix_some_samples((unsigned long) (digiwobufdata+((digiwobufsize/digiwobufdivs)*digiwobufpos)), 0, TRUE); + _mix_some_samples((unsigned long long) (digiwobufdata+((digiwobufsize/digiwobufdivs)*digiwobufpos)), 0, TRUE); } } @@ -309,7 +309,7 @@ static int digi_waveout_init(int input, int voices) goto Error; } - _mix_some_samples((unsigned long) digiwobufdata, 0, TRUE); + _mix_some_samples((unsigned long long) digiwobufdata, 0, TRUE); /* get volume */ waveOutGetVolume(hWaveOut, &initial_volume);