Silence some Xcode compiler warnings

This commit is contained in:
Aaron Culliney 2018-01-21 13:18:49 -08:00
parent e898a85f50
commit dd42645c4c
16 changed files with 84 additions and 73 deletions

View File

@ -77,6 +77,7 @@
int fd = -1;
TEMP_FAILURE_RETRY(fd = open(path, ro ? O_RDONLY : O_RDWR));
const char *errMsg = disk6_insert(fd, drive, path, ro);
(void)errMsg;
if (fd >= 0) {
TEMP_FAILURE_RETRY(close(fd));
}

View File

@ -173,7 +173,7 @@ void sound_ay_init( CAY8910 *_this )
_this->ay_env_internal_tick = _this->ay_env_tick = _this->ay_env_period = 0;
_this->ay_tone_subcycles = _this->ay_env_subcycles = 0;
for( f = 0; f < 3; f++ )
_this->ay_tone_tick[f] = _this->ay_tone_high[f] = 0, _this->ay_tone_period[f] = 1;
_this->ay_tone_tick[f] = _this->ay_tone_high[f] = 0; _this->ay_tone_period[f] = 1;
_this->ay_change_count = 0;
}

View File

@ -30,7 +30,7 @@ void AY8910_InitAll(int nClock, unsigned long nSampleRate);
void AY8910_InitClock(int nClock, unsigned long nSampleRate);
uint8_t* AY8910_GetRegsPtr(unsigned int uChip);
void AY8910UpdateSetCycles();
void AY8910UpdateSetCycles(void);
#if 1 // APPLE2IX
bool _ay8910_saveState(StateHelper_s *helper, unsigned int chip);

View File

@ -1243,6 +1243,7 @@ static void MB_Update()
{
unsigned long modTwo = (dwDSLockedBufferSize0 % 2);
assert(modTwo == 0);
(void)modTwo;
}
memcpy(pDSLockedBuffer0, &g_nMixBuffer[bufIdx/sizeof(short)], dwDSLockedBufferSize0);
MockingboardVoice->Unlock(MockingboardVoice, dwDSLockedBufferSize0);

View File

@ -95,23 +95,23 @@ extern bool g_bMBTimerIrqActive;
extern uint32_t g_uTimer1IrqCount; // DEBUG
#endif
void MB_Initialize();
void MB_Reinitialize();
void MB_Destroy();
void MB_Initialize(void);
void MB_Reinitialize(void);
void MB_Destroy(void);
void MB_SetEnabled(bool enabled);
bool MB_ISEnabled(void);
void MB_Reset();
void MB_Reset(void);
void MB_InitializeIO(char *pCxRomPeripheral, unsigned int uSlot4, unsigned int uSlot5);
void MB_Mute();
void MB_Demute();
void MB_StartOfCpuExecute();
void MB_EndOfVideoFrame();
void MB_Mute(void);
void MB_Demute(void);
void MB_StartOfCpuExecute(void);
void MB_EndOfVideoFrame(void);
void MB_UpdateCycles(void);
SS_CARDTYPE MB_GetSoundcardType();
SS_CARDTYPE MB_GetSoundcardType(void);
void MB_SetSoundcardType(SS_CARDTYPE NewSoundcardType);
double MB_GetFramePeriod();
bool MB_IsActive();
unsigned long MB_GetVolume();
double MB_GetFramePeriod(void);
bool MB_IsActive(void);
unsigned long MB_GetVolume(void);
void MB_SetVolumeZeroToTen(unsigned long goesToTen);
void MB_SetVolume(unsigned long dwVolume, unsigned long dwVolumeMax);
#if 1 // APPLE2IX

View File

@ -72,6 +72,7 @@ static AudioBackend_s openal_audio_backend = { { 0 } };
static void _playq_removeNode(ALVoice *voice, PlayNode_s *playNode) {
long err = voice->playq->Remove(voice->playq, playNode);
assert(err == 0);
(void)err;
voice->_queued_total_bytes -= playNode->numBytes;
assert(voice->_queued_total_bytes >= 0);
}
@ -481,6 +482,7 @@ static long openal_createSoundBuffer(const AudioContext_s *audio_context, INOUT
ALCcontext *ctx = (ALCcontext*)(audio_context->_internal);
assert(ctx != NULL);
(void)ctx;
if ((voice = _openal_createVoice(NUM_CHANNELS)) == NULL) {
LOG("OOPS, Cannot create new voice");
@ -530,6 +532,8 @@ static long openal_systemShutdown(INOUT AudioContext_s **audio_context) {
ALCcontext *ctx = (ALCcontext*) (*audio_context)->_internal;
assert(ctx != NULL);
(void)ctx;
(*audio_context)->_internal = NULL;
FREE(*audio_context);

View File

@ -42,7 +42,7 @@ static FILE *cpu_trace_fp = NULL;
// ----------------------------------------------------------------------------
// 65c02 Opcode Jump Table
extern void op_BRK(), op_ORA_ind_x(), op_UNK_65c02(), op_TSB_zpage(), op_ORA_zpage(), op_ASL_zpage(), op_RMB0_65c02(), op_PHP(), op_ORA_imm(), op_ASL_acc(), op_TSB_abs(), op_ORA_abs(), op_ASL_abs(), op_BBR0_65c02(), op_BPL(), op_ORA_ind_y(), op_ORA_ind_zpage(), op_TRB_zpage(), op_ORA_zpage_x(), op_ASL_zpage_x(), op_RMB1_65c02(), op_CLC(), op_ORA_abs_y(), op_INA(), op_TRB_abs(), op_ORA_abs_x(), op_ASL_abs_x(), op_BBR1_65c02(), op_JSR(), op_AND_ind_x(), op_BIT_zpage(), op_AND_zpage(), op_ROL_zpage(), op_RMB2_65c02(), op_PLP(), op_AND_imm(), op_ROL_acc(), op_BIT_abs(), op_AND_abs(), op_ROL_abs(), op_BBR2_65c02(), op_BMI(), op_AND_ind_y(), op_AND_ind_zpage(), op_BIT_zpage_x(), op_AND_zpage_x(), op_ROL_zpage_x(), op_RMB3_65c02(), op_SEC(), op_AND_abs_y(), op_DEA(), op_BIT_abs_x(), op_AND_abs_x(), op_ROL_abs_x(), op_BBR3_65c02(), op_RTI(), op_EOR_ind_x(), op_EOR_zpage(), op_LSR_zpage(), op_RMB4_65c02(), op_PHA(), op_EOR_imm(), op_LSR_acc(), op_JMP_abs(), op_EOR_abs(), op_LSR_abs(), op_BBR4_65c02(), op_BVC(), op_EOR_ind_y(), op_EOR_ind_zpage(), op_EOR_zpage_x(), op_LSR_zpage_x(), op_RMB5_65c02(), op_CLI(), op_EOR_abs_y(), op_PHY(), op_EOR_abs_x(), op_LSR_abs_x(), op_BBR5_65c02(), op_RTS(), op_ADC_ind_x(), op_STZ_zpage(), op_ADC_zpage(), op_ROR_zpage(), op_RMB6_65c02(), op_PLA(), op_ADC_imm(), op_ROR_acc(), op_JMP_ind(), op_ADC_abs(), op_ROR_abs(), op_BBR6_65c02(), op_BVS(), op_ADC_ind_y(), op_ADC_ind_zpage(), op_STZ_zpage_x(), op_ADC_zpage_x(), op_ROR_zpage_x(), op_RMB7_65c02(), op_SEI(), op_ADC_abs_y(), op_PLY(), op_JMP_abs_ind_x(), op_ADC_abs_x(), op_ROR_abs_x(), op_BBR7_65c02(), op_BRA(), op_STA_ind_x(), op_STY_zpage(), op_STA_zpage(), op_STX_zpage(), op_SMB0_65c02(), op_DEY(), op_BIT_imm(), op_TXA(), op_STY_abs(), op_STA_abs(), op_STX_abs(), op_BBS0_65c02(), op_BCC(), op_STA_ind_y(), op_STA_ind_zpage(), op_STY_zpage_x(), op_STA_zpage_x(), op_STX_zpage_y(), op_SMB1_65c02(), op_TYA(), op_STA_abs_y(), op_TXS(), op_STZ_abs(), op_STA_abs_x(), op_STZ_abs_x(), op_BBS1_65c02(), op_LDY_imm(), op_LDA_ind_x(), op_LDX_imm(), op_LDY_zpage(), op_LDA_zpage(), op_LDX_zpage(), op_SMB2_65c02(), op_TAY(), op_LDA_imm(), op_TAX(), op_LDY_abs(), op_LDA_abs(), op_LDX_abs(), op_BBS2_65c02(), op_BCS(), op_LDA_ind_y(), op_LDA_ind_zpage(), op_LDY_zpage_x(), op_LDA_zpage_x(), op_LDX_zpage_y(), op_SMB3_65c02(), op_CLV(), op_LDA_abs_y(), op_TSX(), op_LDY_abs_x(), op_LDA_abs_x(), op_LDX_abs_y(), op_BBS3_65c02(), op_CPY_imm(), op_CMP_ind_x(), op_CPY_zpage(), op_CMP_zpage(), op_DEC_zpage(), op_SMB4_65c02(), op_INY(), op_CMP_imm(), op_DEX(), op_WAI_65c02(), op_CPY_abs(), op_CMP_abs(), op_DEC_abs(), op_BBS4_65c02(), op_BNE(), op_CMP_ind_y(), op_CMP_ind_zpage(), op_CMP_zpage_x(), op_DEC_zpage_x(), op_SMB5_65c02(), op_CLD(), op_CMP_abs_y(), op_PHX(), op_STP_65c02(), op_CMP_abs_x(), op_DEC_abs_x(), op_BBS5_65c02(), op_CPX_imm(), op_SBC_ind_x(), op_CPX_zpage(), op_SBC_zpage(), op_INC_zpage(), op_SMB6_65c02(), op_INX(), op_SBC_imm(), op_NOP(), op_CPX_abs(), op_SBC_abs(), op_INC_abs(), op_BBS6_65c02(), op_BEQ(), op_SBC_ind_y(), op_SBC_ind_zpage(), op_SBC_zpage_x(), op_INC_zpage_x(), op_SMB7_65c02(), op_SED(), op_SBC_abs_y(), op_PLX(), op_SBC_abs_x(), op_INC_abs_x(), op_BBS7_65c02();
extern void op_BRK(void), op_ORA_ind_x(void), op_UNK_65c02(void), op_TSB_zpage(void), op_ORA_zpage(void), op_ASL_zpage(void), op_RMB0_65c02(void), op_PHP(void), op_ORA_imm(void), op_ASL_acc(void), op_TSB_abs(void), op_ORA_abs(void), op_ASL_abs(void), op_BBR0_65c02(void), op_BPL(void), op_ORA_ind_y(void), op_ORA_ind_zpage(void), op_TRB_zpage(void), op_ORA_zpage_x(void), op_ASL_zpage_x(void), op_RMB1_65c02(void), op_CLC(void), op_ORA_abs_y(void), op_INA(void), op_TRB_abs(void), op_ORA_abs_x(void), op_ASL_abs_x(void), op_BBR1_65c02(void), op_JSR(void), op_AND_ind_x(void), op_BIT_zpage(void), op_AND_zpage(void), op_ROL_zpage(void), op_RMB2_65c02(void), op_PLP(void), op_AND_imm(void), op_ROL_acc(void), op_BIT_abs(void), op_AND_abs(void), op_ROL_abs(void), op_BBR2_65c02(void), op_BMI(void), op_AND_ind_y(void), op_AND_ind_zpage(void), op_BIT_zpage_x(void), op_AND_zpage_x(void), op_ROL_zpage_x(void), op_RMB3_65c02(void), op_SEC(void), op_AND_abs_y(void), op_DEA(void), op_BIT_abs_x(void), op_AND_abs_x(void), op_ROL_abs_x(void), op_BBR3_65c02(void), op_RTI(void), op_EOR_ind_x(void), op_EOR_zpage(void), op_LSR_zpage(void), op_RMB4_65c02(void), op_PHA(void), op_EOR_imm(void), op_LSR_acc(void), op_JMP_abs(void), op_EOR_abs(void), op_LSR_abs(void), op_BBR4_65c02(void), op_BVC(void), op_EOR_ind_y(void), op_EOR_ind_zpage(void), op_EOR_zpage_x(void), op_LSR_zpage_x(void), op_RMB5_65c02(void), op_CLI(void), op_EOR_abs_y(void), op_PHY(void), op_EOR_abs_x(void), op_LSR_abs_x(void), op_BBR5_65c02(void), op_RTS(void), op_ADC_ind_x(void), op_STZ_zpage(void), op_ADC_zpage(void), op_ROR_zpage(void), op_RMB6_65c02(void), op_PLA(void), op_ADC_imm(void), op_ROR_acc(void), op_JMP_ind(void), op_ADC_abs(void), op_ROR_abs(void), op_BBR6_65c02(void), op_BVS(void), op_ADC_ind_y(void), op_ADC_ind_zpage(void), op_STZ_zpage_x(void), op_ADC_zpage_x(void), op_ROR_zpage_x(void), op_RMB7_65c02(void), op_SEI(void), op_ADC_abs_y(void), op_PLY(void), op_JMP_abs_ind_x(void), op_ADC_abs_x(void), op_ROR_abs_x(void), op_BBR7_65c02(void), op_BRA(void), op_STA_ind_x(void), op_STY_zpage(void), op_STA_zpage(void), op_STX_zpage(void), op_SMB0_65c02(void), op_DEY(void), op_BIT_imm(void), op_TXA(void), op_STY_abs(void), op_STA_abs(void), op_STX_abs(void), op_BBS0_65c02(void), op_BCC(void), op_STA_ind_y(void), op_STA_ind_zpage(void), op_STY_zpage_x(void), op_STA_zpage_x(void), op_STX_zpage_y(void), op_SMB1_65c02(void), op_TYA(void), op_STA_abs_y(void), op_TXS(void), op_STZ_abs(void), op_STA_abs_x(void), op_STZ_abs_x(void), op_BBS1_65c02(void), op_LDY_imm(void), op_LDA_ind_x(void), op_LDX_imm(void), op_LDY_zpage(void), op_LDA_zpage(void), op_LDX_zpage(void), op_SMB2_65c02(void), op_TAY(void), op_LDA_imm(void), op_TAX(void), op_LDY_abs(void), op_LDA_abs(void), op_LDX_abs(void), op_BBS2_65c02(void), op_BCS(void), op_LDA_ind_y(void), op_LDA_ind_zpage(void), op_LDY_zpage_x(void), op_LDA_zpage_x(void), op_LDX_zpage_y(void), op_SMB3_65c02(void), op_CLV(void), op_LDA_abs_y(void), op_TSX(void), op_LDY_abs_x(void), op_LDA_abs_x(void), op_LDX_abs_y(void), op_BBS3_65c02(void), op_CPY_imm(void), op_CMP_ind_x(void), op_CPY_zpage(void), op_CMP_zpage(void), op_DEC_zpage(void), op_SMB4_65c02(void), op_INY(void), op_CMP_imm(void), op_DEX(void), op_WAI_65c02(void), op_CPY_abs(void), op_CMP_abs(void), op_DEC_abs(void), op_BBS4_65c02(void), op_BNE(void), op_CMP_ind_y(void), op_CMP_ind_zpage(void), op_CMP_zpage_x(void), op_DEC_zpage_x(void), op_SMB5_65c02(void), op_CLD(void), op_CMP_abs_y(void), op_PHX(void), op_STP_65c02(void), op_CMP_abs_x(void), op_DEC_abs_x(void), op_BBS5_65c02(void), op_CPX_imm(void), op_SBC_ind_x(void), op_CPX_zpage(void), op_SBC_zpage(void), op_INC_zpage(void), op_SMB6_65c02(void), op_INX(void), op_SBC_imm(void), op_NOP(void), op_CPX_abs(void), op_SBC_abs(void), op_INC_abs(void), op_BBS6_65c02(void), op_BEQ(void), op_SBC_ind_y(void), op_SBC_ind_zpage(void), op_SBC_zpage_x(void), op_INC_zpage_x(void), op_SMB7_65c02(void), op_SED(void), op_SBC_abs_y(void), op_PLX(void), op_SBC_abs_x(void), op_INC_abs_x(void), op_BBS7_65c02(void);
void *cpu65__opcodes[256] = {
op_BRK, // 00

View File

@ -33,7 +33,7 @@
extern cpu65_run_args_s run_args;
/* Set up the processor for a new run. Sets up opcode table. */
extern void cpu65_init();
extern void cpu65_init(void);
/* Interrupt the processor */
extern void cpu65_interrupt(int reason);

View File

@ -139,7 +139,7 @@ static void _initialize_hires_values(void) {
video__hires_odd[e] = COLOR_LIGHT_WHITE;
if (b > 0)
{
video__hires_even[e-1] = COLOR_LIGHT_WHITE,
video__hires_even[e-1] = COLOR_LIGHT_WHITE;
video__hires_odd [e-1] = COLOR_LIGHT_WHITE;
}
} else {
@ -163,8 +163,8 @@ static void _initialize_hires_values(void) {
}
last_not_black = 1;
} else {
video__hires_even[e] = COLOR_BLACK,
video__hires_odd [e] = COLOR_BLACK,
video__hires_even[e] = COLOR_BLACK;
video__hires_odd [e] = COLOR_BLACK;
last_not_black = 0;
}
}
@ -554,37 +554,37 @@ static void _initialize_interface_fonts(void) {
static inline void _plot_char40(uint8_t **d, uint8_t **s) {
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint16_t *)(*d)) = *((uint16_t *)(*s));
*d += SCANSTEP, *s -= 12;
*d += SCANSTEP; *s -= 12;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint16_t *)(*d)) = *((uint16_t *)(*s));
*d += SCANSTEP, *s += 4;
*d += SCANSTEP; *s += 4;
}
static inline void _plot_char80(uint8_t **d, uint8_t **s, const unsigned int fb_width) {
// FIXME : this is implicitly scaling at FONT_GLYPH_SCALE_Y ... make it explicit
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint16_t *)(*d)) = *((uint16_t *)(*s));
*d += 2, *s += 2;
*d += 2; *s += 2;
*((uint8_t *)(*d)) = *((uint8_t *)(*s));
*d += fb_width-6, *s -= 6;
*d += fb_width-6; *s -= 6;
*((uint32_t *)(*d)) = *((uint32_t *)(*s));
*d += 4, *s += 4;
*d += 4; *s += 4;
*((uint16_t *)(*d)) = *((uint16_t *)(*s));
*d += 2, *s += 2;
*d += 2; *s += 2;
*((uint8_t *)(*d)) = *((uint8_t *)(*s));
*d += fb_width-6, *s += 2;
*d += fb_width-6; *s += 2;
}
static inline void _plot_lores40(uint8_t **d, const uint32_t val) {

View File

@ -139,12 +139,12 @@ extern bool caps_lock;
extern bool use_system_caps_lock;
int c_mygetch(int block);
int c_rawkey();
int c_rawkey(void);
#ifdef INTERFACE_CLASSIC
void c_keys_set_key(int key);
bool c_keys_is_interface_key(int key);
#endif
int c_keys_is_shifted();
int c_keys_is_shifted(void);
int c_keys_ascii_to_scancode(int ch);
void c_keys_handle_input(int scancode, int pressed, int is_cooked);

View File

@ -36,10 +36,10 @@ extern int breakpoints[MAX_BRKPTS]; /* memory breakpoints */
extern int watchpoints[MAX_BRKPTS]; /* memory watchpoints */
// internal debugger commands
extern void clear_debugger_screen();
extern void clear_debugger_screen(void);
extern void bload(FILE*, char*, int, int);
extern void show_misc_info();
extern uint8_t get_current_opcode();
extern void show_misc_info(void);
extern uint8_t get_current_opcode(void);
extern void dump_mem(int, int, int, int, int);
extern void search_mem(char*, int, int);
extern void set_mem(int, char*);
@ -47,18 +47,18 @@ extern void set_lc_mem(int, int, char*);
extern void disasm(int, int, int, int);
extern void clear_halt(int*, int);
extern bool set_halt(int*, int);
extern void show_breakpts();
extern void show_regs();
extern void display_help();
extern void show_lc_info();
extern void show_disk_info();
extern void show_breakpts(void);
extern void show_regs(void);
extern void display_help(void);
extern void show_lc_info(void);
extern void show_disk_info(void);
extern void set_halt_opcode(uint8_t opcode);
extern void set_halt_65c02();
extern void clear_halt_65c02();
extern void set_halt_65c02(void);
extern void clear_halt_65c02(void);
extern void clear_halt_opcode(uint8_t opcode);
extern void show_opcode_breakpts();
extern void show_opcode_breakpts(void);
extern int debugger_go(stepping_struct_t s);
extern void fb_sha1();
extern void fb_sha1(void);
/*
d{is} {lc1|lc2} {/bank/}{addr} {+}{len}

View File

@ -98,7 +98,7 @@ uint8_t current_opcode;
int op_breakpoints[256]; /* opcode breakpoints */
/* in debug.l */
extern int yylex();
extern int yylex(void);
extern void init_lex(char *buf, int size);
/* -------------------------------------------------------------------------

View File

@ -346,20 +346,20 @@ static uint8_t *touchjoy_rosetteChars(void) {
static void _init_gltouchjoy_joy(void) {
LOG("Registering OpenGL software touch joystick (joystick variant)");
happyHappyJoyJoy.variant = &touchjoy_variant,
happyHappyJoyJoy.resetState = &touchjoy_resetState,
happyHappyJoyJoy.setup = &touchjoy_setup,
happyHappyJoyJoy.shutdown = &touchjoy_shutdown,
happyHappyJoyJoy.variant = &touchjoy_variant;
happyHappyJoyJoy.resetState = &touchjoy_resetState;
happyHappyJoyJoy.setup = &touchjoy_setup;
happyHappyJoyJoy.shutdown = &touchjoy_shutdown;
happyHappyJoyJoy.prefsChanged = &touchjoy_prefsChanged;
happyHappyJoyJoy.buttonDown = &touchjoy_buttonDown,
happyHappyJoyJoy.buttonMove = &touchjoy_buttonMove,
happyHappyJoyJoy.buttonUp = &touchjoy_buttonUp,
happyHappyJoyJoy.buttonDown = &touchjoy_buttonDown;
happyHappyJoyJoy.buttonMove = &touchjoy_buttonMove;
happyHappyJoyJoy.buttonUp = &touchjoy_buttonUp;
happyHappyJoyJoy.axisDown = &touchjoy_axisDown,
happyHappyJoyJoy.axisMove = &touchjoy_axisMove,
happyHappyJoyJoy.axisUp = &touchjoy_axisUp,
happyHappyJoyJoy.axisDown = &touchjoy_axisDown;
happyHappyJoyJoy.axisMove = &touchjoy_axisMove;
happyHappyJoyJoy.axisUp = &touchjoy_axisUp;
happyHappyJoyJoy.rosetteChars = &touchjoy_rosetteChars;

View File

@ -95,6 +95,7 @@ static GLTouchJoyVariant kpadJoy = { 0 };
static inline void _callback_sourceUnlock(volatile int *source) {
int val = __sync_add_and_fetch(source, (int)(CALLBACK_LOCK_VALUE));
assert(val >= 0 && "inconsistent lock state for callback detected");
(void)val;
}
// attempt to lock the critical section where we unschedule the function pointer callback
@ -482,7 +483,6 @@ static void touchkpad_buttonUp(int dx, int dy) {
static void touchkpad_prefsChanged(const char *domain) {
assert(video_isRenderThread());
bool bVal = false;
float fVal = 0.f;
long lVal = 0;
@ -577,20 +577,20 @@ static void _init_gltouchjoy_kpad(void) {
kpad.currButtonDisplayChar = ' ';
kpadJoy.variant = &touchkpad_variant,
kpadJoy.resetState = &touchkpad_resetState,
kpadJoy.setup = &touchkpad_setup,
kpadJoy.shutdown = &touchkpad_shutdown,
kpadJoy.variant = &touchkpad_variant;
kpadJoy.resetState = &touchkpad_resetState;
kpadJoy.setup = &touchkpad_setup;
kpadJoy.shutdown = &touchkpad_shutdown;
kpadJoy.prefsChanged = &touchkpad_prefsChanged;
kpadJoy.buttonDown = &touchkpad_buttonDown,
kpadJoy.buttonMove = &touchkpad_buttonMove,
kpadJoy.buttonUp = &touchkpad_buttonUp,
kpadJoy.buttonDown = &touchkpad_buttonDown;
kpadJoy.buttonMove = &touchkpad_buttonMove;
kpadJoy.buttonUp = &touchkpad_buttonUp;
kpadJoy.axisDown = &touchkpad_axisDown,
kpadJoy.axisMove = &touchkpad_axisMove,
kpadJoy.axisUp = &touchkpad_axisUp,
kpadJoy.axisDown = &touchkpad_axisDown;
kpadJoy.axisMove = &touchkpad_axisMove;
kpadJoy.axisUp = &touchkpad_axisUp;
kpadJoy.rosetteChars = &touchkpad_rosetteChars;

View File

@ -557,7 +557,7 @@ static void gltouchkbd_shutdown(void) {
}
static void gltouchkbd_setup(void) {
LOG("gltouchkbd_setup ... %u", sizeof(kbd));
LOG("gltouchkbd_setup ... %lu", (unsigned long)sizeof(kbd));
gltouchkbd_shutdown();
@ -928,7 +928,6 @@ static void gltouchkbd_applyPrefs(void) {
kbd.selectedRow = -1;
if (kbd.model) {
GLModelHUDElement *hudKeyboard = (GLModelHUDElement *)kbd.model->custom;
glhud_setupDefault(kbd.model);
}

View File

@ -64,7 +64,13 @@ static ssize_t _read_data(int fd_own, uint8_t *buf, const off_t expected_bytesco
int maxtries = 10;
do {
ssize_t bytesread = 0;
TEMP_FAILURE_RETRY(bytesread = read(fd_own, buf+bytescount, expected_bytescount-bytescount));
off_t len0 = expected_bytescount-bytescount;
unsigned int len = (unsigned int)len0;
if (UNLIKELY(len0 > UINT_MAX || len0 < 0)) {
assert(false);
}
TEMP_FAILURE_RETRY(bytesread = read(fd_own, buf+bytescount, len));
if (bytesread <= 0) {
if (--maxtries == 0) {
LOG("OOPS, giving up on read() ...");
@ -402,7 +408,7 @@ const char *zlib_deflate_buffer(const uint8_t *src, const unsigned int src_bytes
}
do {
ssize_t len0 = expected_bytescount-bytescount;
off_t len0 = expected_bytescount-bytescount;
unsigned int len = (unsigned int)len0;
if (UNLIKELY(len0 > UINT_MAX || len0 < 0)) {
assert(false);