Skip to content

Commit

Permalink
src: stop casting to already unsigned values
Browse files Browse the repository at this point in the history
fix build on newer gcc
  • Loading branch information
Apaczer committed Oct 13, 2024
1 parent cfb09c9 commit 08606bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static const int aprox_vol[128]= {-16, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4,

#define CHECK_SOUND_BUFFERS() \
{ \
if ((unsigned)sndbufpt - (unsigned)render_sndbuff >= SNDBUFFER_LEN) { \
if (sndbufpt - render_sndbuff >= SNDBUFFER_LEN) { \
finish_sound_buffer (); \
} \
} \
Expand Down
4 changes: 2 additions & 2 deletions src/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ uae_u8 *restore_disk(int num,uae_u8 *src)
check_prefs_changed_cpu();
}

src = (uae_u8 *)(((unsigned)src)+strlen((char *)src) + 1);
src = (uae_u8 *)((src)+strlen((char *)src) + 1);

return src;
}
Expand Down Expand Up @@ -1615,7 +1615,7 @@ uae_u8 *save_disk(int num,int *len)
dst[0]=dst[1]=0;
}

dst = (uae_u8 *)(((unsigned)dst)+strlen((char *)dst) + 1);
dst = (uae_u8 *)((dst)+strlen((char *)dst) + 1);
*len = dst - dstbak;
return dstbak;
}
Expand Down
6 changes: 3 additions & 3 deletions src/zfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ size_t uae4all_fread( void *ptr, size_t tam, size_t nmiemb, FILE *flujo)
return 0;
if (uae4all_disk_pos[i]>=uae4all_disk_len[i])
return 0;
memcpy(ptr,(void *)(((unsigned)uae4all_disk_memory[i])+((unsigned)uae4all_disk_pos[i])),tam*nmiemb);
memcpy(ptr,(void *)((uae4all_disk_memory[i])+(uae4all_disk_pos[i])),tam*nmiemb);
uae4all_disk_pos[i]+=tam*nmiemb;
return nmiemb;
}
Expand All @@ -386,7 +386,7 @@ size_t uae4all_fwrite( void *ptr, size_t tam, size_t nmiemb, FILE *flujo)
return 0;
if (uae4all_disk_pos[i]>=uae4all_disk_len[i])
return 0;
memcpy((void *)(((unsigned)uae4all_disk_memory[i])+((unsigned)uae4all_disk_pos[i])),ptr,tam*nmiemb);
memcpy((void *)((uae4all_disk_memory[i])+(uae4all_disk_pos[i])),ptr,tam*nmiemb);
uae4all_disk_pos[i]+=tam*nmiemb;
uae4all_disk_writed[i]=1;
return nmiemb;
Expand Down Expand Up @@ -504,7 +504,7 @@ size_t uae4all_rom_fread(void *ptr, size_t tam, size_t nmiemb, FILE *flujo)
return 0;
if (uae4all_rom_pos>=uae4all_rom_len)
return 0;
memcpy(ptr,(void *)(((unsigned)uae4all_rom_memory)+((unsigned)uae4all_rom_pos)),tam*nmiemb);
memcpy(ptr,(void *)((uae4all_rom_memory)+(uae4all_rom_pos)),tam*nmiemb);

uae4all_rom_fseek(flujo,tam*nmiemb,SEEK_CUR);
return (uae4all_rom_pos-rpos)/tam;
Expand Down

0 comments on commit 08606bf

Please sign in to comment.