From 9dd4c8887d4f6638070e70e5c7004f91cff4949e Mon Sep 17 00:00:00 2001 From: redcode Date: Mon, 23 Mar 2015 07:36:17 +0100 Subject: [PATCH] "const" correctness. --- Z80.CPU/v1.0/sources/Z80.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Z80.CPU/v1.0/sources/Z80.c b/Z80.CPU/v1.0/sources/Z80.c index 15f2e55..4fb77e5 100644 --- a/Z80.CPU/v1.0/sources/Z80.c +++ b/Z80.CPU/v1.0/sources/Z80.c @@ -149,7 +149,7 @@ Q_INLINE void write_16bit(Z80 *object, quint16 address, quint16 value) /* MARK: - P/V Flag Computation */ -Q_PRIVATE const quint8 pf_parity_table[256] = { +Q_PRIVATE quint8 const pf_parity_table[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ 4, 0, 0, 4, 0, 4, 4, 0, 0, 4, 4, 0, 4, 0, 0, 4, /* 1 */ 0, 4, 4, 0, 4, 0, 0, 4, 4, 0, 0, 4, 0, 4, 4, 0, @@ -211,7 +211,7 @@ VF(sbc, 16, 32, -, -32768, 32767) '----------' | 111 = a | | 111 = a | | 111 = a | '---------' '-----------' '----------*/ -Q_PRIVATE const quint8 x_y_table[8] = { +Q_PRIVATE quint8 const x_y_table[8] = { O(state.Q_Z80_STATE_MEMBER_B), O(state.Q_Z80_STATE_MEMBER_C), O(state.Q_Z80_STATE_MEMBER_D), @@ -222,7 +222,7 @@ Q_PRIVATE const quint8 x_y_table[8] = { O(state.Q_Z80_STATE_MEMBER_A) }; -Q_PRIVATE const quint8 j_k_p_q_table[8] = { +Q_PRIVATE quint8 const j_k_p_q_table[8] = { O(state.Q_Z80_STATE_MEMBER_B), O(state.Q_Z80_STATE_MEMBER_C), O(state.Q_Z80_STATE_MEMBER_D), @@ -257,21 +257,21 @@ R_8(_____kkk , j_k_p_q_table, 1, 7, ) | 11 = sp | | 11 = af | | 11 = sp | '---------' '---------' '--------*/ -Q_PRIVATE const quint8 s_table[4] = { +Q_PRIVATE quint8 const s_table[4] = { O(state.Q_Z80_STATE_MEMBER_BC), O(state.Q_Z80_STATE_MEMBER_DE), O(state.Q_Z80_STATE_MEMBER_HL), O(state.Q_Z80_STATE_MEMBER_SP) }; -Q_PRIVATE const quint8 t_table[4] = { +Q_PRIVATE quint8 const t_table[4] = { O(state.Q_Z80_STATE_MEMBER_BC), O(state.Q_Z80_STATE_MEMBER_DE), O(state.Q_Z80_STATE_MEMBER_HL), O(state.Q_Z80_STATE_MEMBER_AF) }; -Q_PRIVATE const quint8 w_table[4] = { +Q_PRIVATE quint8 const w_table[4] = { O(state.Q_Z80_STATE_MEMBER_BC), O(state.Q_Z80_STATE_MEMBER_DE), O(xy ), @@ -302,7 +302,7 @@ R_16(__tt____ , t_table, 0) | 111 = m | '---------*/ -Q_PRIVATE const quint8 z_table[8] = {ZF, ZF, CF, CF, PF, PF, SF, SF}; +Q_PRIVATE quint8 const z_table[8] = {ZF, ZF, CF, CF, PF, PF, SF, SF}; Q_INLINE qboolean __zzz___(Z80 *object) { @@ -1249,7 +1249,7 @@ INSTRUCTION(XY_illegal); /* MARK: - Instruction Function Tables */ -Q_PRIVATE const Instruction instruction_table[256] = { +Q_PRIVATE Instruction const instruction_table[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ nop, ld_SS_WORD, ld_vbc_a, inc_SS, V_X, V_X, ld_X_BYTE, rlca, ex_af_af_, add_hl_SS, ld_a_vbc, dec_SS, V_X, V_X, ld_X_BYTE, rrca, /* 1 */ djnz_OFFSET, ld_SS_WORD, ld_vde_a, inc_SS, V_X, V_X, ld_X_BYTE, rla, jr_OFFSET, add_hl_SS, ld_a_vde, dec_SS, V_X, V_X, ld_X_BYTE, rra, @@ -1269,7 +1269,7 @@ Q_PRIVATE const Instruction instruction_table[256] = { /* F */ ret_Z, pop_TT, jp_Z_WORD, di, call_Z_WORD, push_TT, U_a_BYTE, rst_N, ret_Z, ld_sp_hl, jp_Z_WORD, ei, call_Z_WORD, FD, U_a_BYTE, rst_N }; -Q_PRIVATE const Instruction instruction_table_CB[256] = { +Q_PRIVATE Instruction const instruction_table_CB[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_vhl, G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_vhl, G_Y, /* 1 */ G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_vhl, G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_Y, G_vhl, G_Y, @@ -1289,7 +1289,7 @@ Q_PRIVATE const Instruction instruction_table_CB[256] = { /* F */ M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_vhl, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_Y, M_N_vhl, M_N_Y }; -Q_PRIVATE const Instruction instruction_table_XY_CB[256] = { +Q_PRIVATE Instruction const instruction_table_XY_CB[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET, G_vXYOFFSET_Y, /* 1 */ G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET_Y, G_vXYOFFSET, G_vXYOFFSET_Y, @@ -1309,7 +1309,7 @@ Q_PRIVATE const Instruction instruction_table_XY_CB[256] = { /* F */ M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET_Y, M_N_vXYOFFSET, M_N_vXYOFFSET_Y }; -Q_PRIVATE const Instruction instruction_table_XY[256] = { +Q_PRIVATE Instruction const instruction_table_XY[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, add_XY_WW, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, /* 1 */ XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, add_XY_WW, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, @@ -1329,7 +1329,7 @@ Q_PRIVATE const Instruction instruction_table_XY[256] = { /* F */ XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, ld_sp_XY, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal, XY_illegal }; -Q_PRIVATE const Instruction instruction_table_ED[256] = { +Q_PRIVATE Instruction const instruction_table_ED[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, /* 1 */ ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, ED_illegal, @@ -1585,7 +1585,7 @@ Z80_API void z80_irq(Z80 *object, qboolean state) {INT = state;} # include - Q_PRIVATE const QEmulatorExport exports[7] = { + Q_PRIVATE QEmulatorExport const exports[7] = { {Q_EMULATOR_ACTION_POWER, (QDo)z80_power }, {Q_EMULATOR_ACTION_RESET, (QDo)z80_reset }, {Q_EMULATOR_ACTION_RUN, (QDo)z80_run }, @@ -1597,7 +1597,7 @@ Z80_API void z80_irq(Z80 *object, qboolean state) {INT = state;} # define SLOT_OFFSET(name) Q_OFFSET_OF(Z80, cb.name) - Q_PRIVATE const QEmulatorSlotLinkage slot_linkages[6] = { + Q_PRIVATE QEmulatorSlotLinkage const slot_linkages[6] = { {Q_EMULATOR_OBJECT_MEMORY, Q_EMULATOR_ACTION_READ_8BIT, SLOT_OFFSET(read )}, {Q_EMULATOR_OBJECT_MEMORY, Q_EMULATOR_ACTION_WRITE_8BIT, SLOT_OFFSET(write )}, {Q_EMULATOR_OBJECT_IO, Q_EMULATOR_ACTION_IN_8BIT, SLOT_OFFSET(in )}, @@ -1606,7 +1606,7 @@ Z80_API void z80_irq(Z80 *object, qboolean state) {INT = state;} {Q_EMULATOR_OBJECT_MACHINE, Q_EMULATOR_ACTION_HALT, SLOT_OFFSET(halt )} }; - Q_API_EXPORT const QCPUEmulatorABI abi_emulation_cpu_z80 = { + Q_API_EXPORT QCPUEmulatorABI const abi_emulation_cpu_z80 = { 0, NULL, 7, exports, {sizeof(Z80), Q_OFFSET_OF(Z80, state), 6, slot_linkages} };