Fixes various warnings on clang 9.0

This commit is contained in:
driver1998
2019-03-20 02:42:55 +08:00
parent faafb78c6e
commit 27fc87f5e8
18 changed files with 63 additions and 63 deletions

View File

@@ -1911,7 +1911,7 @@ config_dump(void)
while (sec != NULL) {
entry_t *ent;
if (sec->name && sec->name[0])
if (sec->name[0])
config_log("[%s]\n", sec->name);
ent = (entry_t *)sec->entry_head.next;

View File

@@ -1112,7 +1112,7 @@ d86f_get_bit(int drive, int side)
/* In some cases, misindentification occurs so we need to make sure the surface data array is not
not NULL. */
if (d86f_has_surface_desc(drive) && dev->track_surface_data && dev->track_surface_data[side]) {
if (d86f_has_surface_desc(drive) && dev->track_surface_data[side]) {
if (d86f_reverse_bytes(drive)) {
surface_data = dev->track_surface_data[side][track_word] & 0xFF;
} else {
@@ -1124,7 +1124,7 @@ d86f_get_bit(int drive, int side)
current_bit = (encoded_data >> track_bit) & 1;
dev->last_word[side] <<= 1;
if (d86f_has_surface_desc(drive) && dev->track_surface_data && dev->track_surface_data[side]) {
if (d86f_has_surface_desc(drive) && dev->track_surface_data[side]) {
surface_bit = (surface_data >> track_bit) & 1;
if (! surface_bit)
dev->last_word[side] |= current_bit;

View File

@@ -209,7 +209,7 @@ typedef u_int32_t caddr32_t;
#endif
#endif
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
typedef uintptr_t ipqp_32;
typedef uintptr_t ipasfragp_32;
#else
@@ -230,7 +230,7 @@ typedef caddr32_t ipasfragp_32;
#endif
struct ipovly {
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
uintptr_t ih_next, ih_prev; /* for protocol sequence q's */
#else
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */
@@ -258,7 +258,7 @@ struct ipovly {
* size 28 bytes
*/
struct ipq {
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
uintptr_t next,prev; /* to other reass headers */
#else
ipqp_32 next,prev; /* to other reass headers */

View File

@@ -33,7 +33,7 @@
#ifndef _TCP_H_
#define _TCP_H_
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
typedef uintptr_t tcp_seq;
#else
typedef u_int32_t tcp_seq;

View File

@@ -36,7 +36,7 @@
#include "tcpip.h"
#include "tcp_timer.h"
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
typedef uintptr_t tcpiphdrp_32;
#else
#if SIZEOF_CHAR_P == 4
@@ -178,7 +178,7 @@ struct tcpcb {
* port numbers (which are no longer needed once we've located the
* tcpcb) are overlayed with an mbuf pointer.
*/
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
typedef uintptr_t mbufp_32;
#else
#if SIZEOF_CHAR_P == 4

View File

@@ -58,7 +58,7 @@
#define FONT_FILE_OCRB L"ocra.ttf"
extern const void
extern void
select_codepage(uint16_t code, uint16_t *curmap);

View File

@@ -10,12 +10,12 @@
*
* Version: @(#)prt_cpmap.c 1.0.2 2018/10/05
*
* Authors: Michael Dr<44>ing, <michael@drueing.de>
* Authors: Michael Dr<44>ing, <michael@drueing.de>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Based on code by Frederic Weymann (originally for DosBox.)
*
* Copyright 2018 Michael Dr<44>ing.
* Copyright 2018 Michael Dr<44>ing.
* Copyright 2018 Fred N. van Kempen.
*
* Redistribution and use in source and binary forms, with
@@ -572,7 +572,7 @@ static const struct {
/* Select a ASCII->Unicode mapping by CP number */
const void
void
select_codepage(uint16_t code, uint16_t *curmap)
{
int i = 0;

View File

@@ -910,7 +910,7 @@ ncr_callback(void *priv)
ncr_log("Select - target ID = %i\n", ncr->target_id);
/*Once the device has been found and selected, mark it as busy*/
if ((ncr->target_id != -1) && scsi_device_present(&scsi_devices[ncr->target_id])) {
if ((ncr->target_id != (uint8_t)-1) && scsi_device_present(&scsi_devices[ncr->target_id])) {
ncr->cur_bus |= BUS_BSY;
ncr_log("Device found at ID %i\n", ncr->target_id);
ncr_log("Current Bus BSY=%02x\n", ncr->cur_bus);

View File

@@ -21,7 +21,7 @@
* Copyright 2009-2018 Artyom Tarasenko.
* Copyright 2017,2018 Miran Grca.
*/
#ifndef SCSI_NCR5C38XX_H
#ifndef SCSI_NCR53C8XX_H
# define SCSI_NCR53C8XX_H

View File

@@ -31,7 +31,7 @@
#include "win.h"
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -36,7 +36,7 @@ static device_context_t config_device;
static uint8_t deviceconfig_changed = 0;
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -150,7 +150,7 @@ static int get_pov(HWND hdlg, int id)
return axis_sel - nr_povs;
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -20,7 +20,7 @@
#include <dinput.h>
#include <stdio.h>
#include <stdint.h>
#include "../86Box.h"
#include "../86box.h"
#include "../mouse.h"
#include "../plat.h"
#include "win.h"
@@ -60,10 +60,10 @@ win_mouse_init(void)
void
win_mouse_close(void)
{
if (lpdi_mouse != NULL) {
if (lpdi_mouse != NULL) {
lpdi_mouse->Release();
lpdi_mouse = NULL;
}
}
}
@@ -71,8 +71,8 @@ void
mouse_poll(void)
{
static int buttons = 0;
static int x = 0, y = 0, z = 0;
int b;
static int x = 0, y = 0, z = 0;
int b;
if (FAILED(lpdi_mouse->GetDeviceState(sizeof(DIMOUSESTATE),
(LPVOID)&mousestate))) {
@@ -81,23 +81,23 @@ mouse_poll(void)
}
if (mouse_capture || video_fullscreen) {
if (x != mousestate.lX || y != mousestate.lY || z != mousestate.lZ) {
mouse_x += mousestate.lX;
mouse_y += mousestate.lY;
mouse_z += mousestate.lZ/120;
if (x != mousestate.lX || y != mousestate.lY || z != mousestate.lZ) {
mouse_x += mousestate.lX;
mouse_y += mousestate.lY;
mouse_z += mousestate.lZ/120;
x = mousestate.lX;
y = mousestate.lY;
z = mousestate.lZ/120;
}
x = mousestate.lX;
y = mousestate.lY;
z = mousestate.lZ/120;
}
b = 0;
if (mousestate.rgbButtons[0] & 0x80) b |= 1;
if (mousestate.rgbButtons[1] & 0x80) b |= 2;
if (mousestate.rgbButtons[2] & 0x80) b |= 4;
if (buttons != b) {
mouse_buttons = b;
buttons = b;
}
b = 0;
if (mousestate.rgbButtons[0] & 0x80) b |= 1;
if (mousestate.rgbButtons[1] & 0x80) b |= 2;
if (mousestate.rgbButtons[2] & 0x80) b |= 4;
if (buttons != b) {
mouse_buttons = b;
buttons = b;
}
}
}

View File

@@ -542,7 +542,7 @@ new_floppy_msgbox(HWND hwnd, int type, void *arg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -154,7 +154,7 @@ image_list_init(HWND hwndList, const uint8_t *icon_ids)
if (icon_ids[i] == 0)
break;
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
hiconItem = LoadIcon(hinstance, (LPCWSTR) ((uint64_t) icon_ids[i]));
#else
hiconItem = LoadIcon(hinstance, (LPCWSTR) ((uint32_t) icon_ids[i]));
@@ -644,7 +644,7 @@ win_settings_machine_recalc_machine(HWND hdlg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -858,7 +858,7 @@ recalc_vid_list(HWND hdlg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -977,7 +977,7 @@ mouse_valid(int num, int m)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -1128,7 +1128,7 @@ mpu401_standalone_allow(void)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -1335,7 +1335,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -1453,7 +1453,7 @@ recalc_hdc_list(HWND hdlg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -1785,7 +1785,7 @@ static void network_recalc_combos(HWND hdlg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -2513,7 +2513,7 @@ recalc_selection(HWND hdlg)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -3211,14 +3211,14 @@ hard_disk_track_all(void)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
#endif
win_settings_hard_disks_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h;
HWND h = NULL;
int old_sel = 0, b = 0, assign = 0;
const uint8_t hd_icons[2] = { 64, 0 };
@@ -4044,14 +4044,14 @@ zip_untrack(uint8_t id)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
#endif
win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h;
HWND h = NULL;
int i = 0, old_sel = 0;
WCHAR szText[256];
const uint8_t fd_icons[15] = { 248, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 0 };
@@ -4150,14 +4150,14 @@ win_settings_floppy_drives_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM l
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
#endif
win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h;
HWND h = NULL;
int old_sel = 0, b = 0, assign = 0;
uint32_t b2 = 0;
const uint8_t cd_icons[3] = { 249, 32, 0 };
@@ -4498,7 +4498,7 @@ win_settings_communicate_closure(void)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
@@ -4524,14 +4524,14 @@ win_settings_confirm(HWND hdlg, int button)
}
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK
#endif
win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h;
HWND h = NULL;
int category, i = 0, j = 0;
const uint8_t cat_icons[11] = { 240, 241, 242, 243, 80, 244, 245, 64, 246, 247, 0 };

View File

@@ -35,7 +35,7 @@
static uint8_t old_gain;
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -796,7 +796,7 @@ ui_sb_mount_zip_img(uint8_t id, int part, uint8_t wp, wchar_t *file_name)
/* Handle messages for the Status Bar window. */
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK

View File

@@ -349,7 +349,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Main Window. */
MoveWindow(hwnd, rect.left, rect.top,
unscaled_size_x + (GetSystemMetrics(vid_resize ? SM_CXSIZEFRAME : SM_CXFIXEDFRAME) * 2),
unscaled_size_y + (GetSystemMetrics(SM_CYEDGE) * 2) + (GetSystemMetrics(vid_resize ? SM_CYSIZEFRAME : SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 17 + sb_borders[1] + 1,
unscaled_size_y + (GetSystemMetrics(SM_CYEDGE) * 2) + (GetSystemMetrics(vid_resize ? SM_CYSIZEFRAME : SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENUSIZE) + GetSystemMetrics(SM_CYCAPTION) + 17 + sb_borders[1] + 1,
TRUE);
/* Render window. */
@@ -726,7 +726,7 @@ ui_init(int nCmdShow)
WNDCLASSEX wincl; /* buffer for main window's class */
RAWINPUTDEVICE ridev; /* RawInput device */
MSG messages; /* received-messages buffer */
HWND hwnd; /* handle for our window */
HWND hwnd = NULL; /* handle for our window */
HACCEL haccel; /* handle to accelerator table */
int bRet;
@@ -1060,7 +1060,7 @@ plat_mouse_capture(int on)
/* Catch WM_INPUT messages for 'current focus' window. */
static LONG_PTR input_orig_proc;
static HWND input_orig_hwnd = NULL;
#ifdef __amd64__
#if defined(__amd64__) || defined(__aarch64__)
static LRESULT CALLBACK
#else
static BOOL CALLBACK