Fix warnings for gcc 6.2.0

This commit is contained in:
Fabio Olimpieri 2017-01-07 10:57:20 +01:00
parent bc11eb28e5
commit d6ec2fc6fb
10 changed files with 46 additions and 43 deletions

View File

@ -1410,8 +1410,7 @@ inline void read_keyboard () {
break; break;
case SDLK_F6: // PLAY tape case SDLK_F6: // PLAY tape
if (ordenador.tape_fast_load == 0) if (ordenador.tape_fast_load == 0) ordenador.tape_stop = 0;
ordenador.tape_stop = 0;
ordenador.tape_stop_fast = 0; ordenador.tape_stop_fast = 0;
ordenador.stop_tape_start_countdown = 0; ordenador.stop_tape_start_countdown = 0;
break; break;
@ -2421,9 +2420,9 @@ void Z80free_Out_fake (register word Port, register byte Value) {
inline byte Z80free_In_internal (register word Port) { inline byte Z80free_In_internal (register word Port) {
static unsigned int temporal_io; unsigned int temporal_io;
static byte pines, pines_rzx; byte pines, pines_rzx;
static int error; int error;
if (ordenador.playing_rzx) if (ordenador.playing_rzx)
{ {

View File

@ -300,21 +300,21 @@ struct computer {
void computer_init(); void computer_init();
void register_screen(SDL_Surface *); void register_screen(SDL_Surface *);
inline void show_screen(int); void show_screen(int);
inline void show_screen_precision(int); void show_screen_precision(int);
inline void paint_pixels(unsigned char, unsigned char, unsigned char, unsigned char draw); void paint_pixels(unsigned char, unsigned char, unsigned char, unsigned char draw);
inline void paint_pixels_precision(unsigned char, unsigned char, unsigned char,unsigned char draw); void paint_pixels_precision(unsigned char, unsigned char, unsigned char,unsigned char draw);
inline void read_keyboard(); void read_keyboard();
void fill_audio(void *udata,Uint8 *,int); void fill_audio(void *udata,Uint8 *,int);
void set_volume(unsigned char); void set_volume(unsigned char);
inline void play_sound(unsigned int); void play_sound(unsigned int);
inline void emulate_screen(int); void emulate_screen(int);
inline void emulate(int); void emulate(int);
void ResetComputer(); void ResetComputer();
inline byte bus_empty(); byte bus_empty();
void set_memory_pointers(); void set_memory_pointers();
inline void play_ay(); void play_ay();
inline void paint_one_pixel(unsigned char *colour,unsigned char *address); void paint_one_pixel(unsigned char *colour,unsigned char *address);
void computer_set_palete(); void computer_set_palete();
void set_palete_entry(unsigned char entry, byte Value); void set_palete_entry(unsigned char entry, byte Value);
void restart_video(); void restart_video();

View File

@ -247,7 +247,7 @@ unsigned char InitNetwork()
memset(myIP, 0, sizeof(myIP)); memset(myIP, 0, sizeof(myIP));
printf("Getting IP address via DHCP...\n"); printf("Getting IP address via DHCP...\n");
if (if_config(myIP, NULL, NULL, 1) < 0) { if (if_config(myIP, NULL, NULL, 1, 10) < 0) {
printf("No DHCP reply\n"); printf("No DHCP reply\n");
return 0; return 0;
} }

View File

@ -305,7 +305,7 @@ static const char **get_file_list_zip(const char *path)
if (!uf) return NULL; if (!uf) return NULL;
err = unzGetGlobalInfo (uf,&gi); err = unzGetGlobalInfo (uf,&gi);
if (err!=UNZ_OK) printf("error %d with zipfile in unzGetGlobalInfo \n",err); if (err!=UNZ_OK) {printf("error %d with zipfile in unzGetGlobalInfo \n",err);}
file_list = (const char**)malloc((gi.number_entry +3) * sizeof(char*)); file_list = (const char**)malloc((gi.number_entry +3) * sizeof(char*));
file_list[cur++] = strdup("None"); file_list[cur++] = strdup("None");

View File

@ -261,7 +261,7 @@ int sound_init_sdl() {
#ifdef GEKKO #ifdef GEKKO
int voice; int voice;
void callback(int voice) void callback(long int voice)
{} {}
int sound_init_asnd() { int sound_init_asnd() {

View File

@ -21,8 +21,8 @@
#ifndef H_SPK_AY #ifndef H_SPK_AY
#define H_SPK_AY #define H_SPK_AY
inline void play_ay (unsigned int); void play_ay (unsigned int);
inline void play_sound (unsigned int); void play_sound (unsigned int);
void reset_sound(void); void reset_sound(void);
#endif #endif

View File

@ -664,9 +664,10 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
if (ordenador.tape_block_level>tstados) ordenador.tape_counter0 = ordenador.tape_block_level - tstados; if (ordenador.tape_block_level>tstados) ordenador.tape_counter0 = ordenador.tape_block_level - tstados;
else ordenador.tape_counter0 = 0; else ordenador.tape_counter0 = 0;
ordenador.tape_counter1 = 0; ordenador.tape_counter1 = 0;
} else } else {
ordenador.tape_current_mode = TAP_TRASH; // next ID ordenador.tape_current_mode = TAP_TRASH; // next ID
ordenador.next_block= NOBLOCK; ordenador.next_block= NOBLOCK;
}
break; break;
case TZX_SEQ_PULSES: case TZX_SEQ_PULSES:
@ -678,9 +679,10 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
if (ordenador.tape_block_level>tstados) ordenador.tape_counter0 = ordenador.tape_block_level - tstados; if (ordenador.tape_block_level>tstados) ordenador.tape_counter0 = ordenador.tape_block_level - tstados;
else ordenador.tape_counter0 = 0; else ordenador.tape_counter0 = 0;
ordenador.tape_counter1 = 0; ordenador.tape_counter1 = 0;
} else } else {
ordenador.tape_current_mode = TAP_TRASH; // next ID ordenador.tape_current_mode = TAP_TRASH; // next ID
ordenador.next_block= NOBLOCK; ordenador.next_block= NOBLOCK;
}
break; break;
case TAP_STOP: case TAP_STOP:
@ -1301,12 +1303,14 @@ end_fast_load_routine:
{ {
retval=fread (value, 1, 5, fichero); //read till flag byte retval=fread (value, 1, 5, fichero); //read till flag byte
if (retval==5) if (retval==5)
{
if ((value[4]!=0x0)&&(value[4]!=0xFF)) blockid=0x1; //custom data if ((value[4]!=0x0)&&(value[4]!=0xFF)) blockid=0x1; //custom data
if ((value[4]==0x0)&&((value[2]+value[3]*256)!=0x13)) blockid=0x1; //custom data if ((value[4]==0x0)&&((value[2]+value[3]*256)!=0x13)) blockid=0x1; //custom data
if ((value[4]==0xFF)&&(ordenador.next_block==NOBLOCK)) blockid=0x2; //standard data if ((value[4]==0xFF)&&(ordenador.next_block==NOBLOCK)) blockid=0x2; //standard data
//printf("TZX: ID_fast2: %X en %d\n",blockid,byte_position+1); //printf("TZX: ID_fast2: %X en %d\n",blockid,byte_position+1);
//printf("TZX: next block: %X \n",ordenador.next_block); //printf("TZX: next block: %X \n",ordenador.next_block);
} }
}
if (blockid!=0x10) if (blockid!=0x10)
{ {
//Anticipate auto ultra fast mode //Anticipate auto ultra fast mode

View File

@ -21,9 +21,9 @@
#ifndef H_TAPE #ifndef H_TAPE
#define H_TAPE #define H_TAPE
inline void tape_read(FILE *, int); void tape_read(FILE *, int);
inline void tape_read_tap(FILE *, int); void tape_read_tap(FILE *, int);
inline void tape_read_tzx(FILE *, int); void tape_read_tzx(FILE *, int);
void rewind_tape(FILE *,unsigned char); void rewind_tape(FILE *,unsigned char);
unsigned char file_empty(FILE *); unsigned char file_empty(FILE *);
void fastload_block_tap (FILE *); void fastload_block_tap (FILE *);

View File

@ -852,7 +852,7 @@ execute_open_actv_retry:
addr.sin_addr.s_addr = net_gethostip(); addr.sin_addr.s_addr = net_gethostip();
sprintf(buf, "PORT %u,%u,%u,%u,%u,%u", sprintf(buf, "PORT %lu,%lu,%lu,%lu,%u,%u",
(ntohl(addr.sin_addr.s_addr) >> 24) & 0xff, (ntohl(addr.sin_addr.s_addr) >> 24) & 0xff,
(ntohl(addr.sin_addr.s_addr) >> 16) & 0xff, (ntohl(addr.sin_addr.s_addr) >> 16) & 0xff,
(ntohl(addr.sin_addr.s_addr) >> 8) & 0xff, (ntohl(addr.sin_addr.s_addr) >> 8) & 0xff,
@ -914,7 +914,7 @@ execute_open_actv_retry:
NET_PRINTF("offset=%u:%u\n", (u32)(offset >> 32), (u32)(offset & 0xffffFFFF)); NET_PRINTF("offset=%u:%u\n", (u32)(offset >> 32), (u32)(offset & 0xffffFFFF));
sprintf(buf, "REST %u%u", high_part, low_part ); sprintf(buf, "REST %lu%lu", high_part, low_part );
NET_PRINTF("REST=%s\n",buf); NET_PRINTF("REST=%s\n",buf);
if((res = ftp_execute(env, buf, 350, 1)) < 0) if((res = ftp_execute(env, buf, 350, 1)) < 0)
{ {
@ -1130,7 +1130,7 @@ execute_open_retry:
NET_PRINTF("offset=%u:%u\n", (u32)(offset >> 32), (u32)(offset & 0xffffFFFF)); NET_PRINTF("offset=%u:%u\n", (u32)(offset >> 32), (u32)(offset & 0xffffFFFF));
sprintf(buf, "REST %u%u", high_part, low_part ); sprintf(buf, "REST %lu%lu", high_part, low_part );
NET_PRINTF("REST=%s\n",buf); NET_PRINTF("REST=%s\n",buf);
if((res = ftp_execute(env, buf, 350, 1)) < 0) if((res = ftp_execute(env, buf, 350, 1)) < 0)
{ {
@ -1782,7 +1782,7 @@ read_retry:
return false; return false;
} }
if( SocketSend( data_sock, (char*)buf, len) < 0) if( SocketSend( data_sock, (char*)buf, len) == false)
{ {
goto read_retry; goto read_retry;
} }
@ -2827,7 +2827,7 @@ bool ftpInitDevice(const char* name, const char *user, const char *password, con
for(i=0;i<MAX_FTP_MOUNTED && FTPEnv[i].name!=NULL;i++); for(i=0;i<MAX_FTP_MOUNTED && FTPEnv[i].name!=NULL;i++);
if(i==MAX_FTP_MOUNTED) return false; //all allowed ftp connections reached if(i==MAX_FTP_MOUNTED) return false; //all allowed ftp connections reached
if (if_config(myIP, NULL, NULL, true) < 0) if (if_config(myIP, NULL, NULL, true, 10) < 0)
return false; return false;
_FTP_lock(); _FTP_lock();

View File

@ -761,15 +761,15 @@ int Z80free_codesED (Z80FREE *processor,byte opcode) {
return (17); return (17);
} else { } else {
//Bit3 and bit 5 are set only at the end of the loop to save cpu time //Bit3 and bit 5 are set only at the end of the loop to save cpu time
if (processor->Rm.br.F&F_H) if (processor->Rm.br.F&F_H) tmp1--;
tmp1--;
Z80free_valFlag(processor,F_3,tmp1&0x08); Z80free_valFlag(processor,F_3,tmp1&0x08);
Z80free_valFlag(processor,F_5,tmp1&0x02); Z80free_valFlag(processor,F_5,tmp1&0x02);
Z80free_resFlag(processor,F_PV); Z80free_resFlag(processor,F_PV);
Z80free_setFlag(processor,F_N); Z80free_setFlag(processor,F_N);
Z80free_valFlag(processor,F_C,tmp2); Z80free_valFlag(processor,F_C,tmp2);
if (processor->Rm.wr.BC) if (processor->Rm.wr.BC)
Z80free_setFlag(processor,F_PV); return (12); Z80free_setFlag(processor,F_PV);
return (12);
} }
break; break;
case 178: // INIR case 178: // INIR
@ -850,8 +850,8 @@ int Z80free_codesED (Z80FREE *processor,byte opcode) {
Z80free_resFlag(processor,F_PV); Z80free_resFlag(processor,F_PV);
Z80free_setFlag(processor,F_N); Z80free_setFlag(processor,F_N);
Z80free_valFlag(processor,F_C,tmp2); Z80free_valFlag(processor,F_C,tmp2);
if (processor->Rm.wr.BC) if (processor->Rm.wr.BC) Z80free_setFlag(processor,F_PV);
Z80free_setFlag(processor,F_PV); return (12); return (12);
} }
break; break;
case 186: // INDR case 186: // INDR