diff options
author | Angelo Salese <angelosa@users.noreply.github.com> | 2012-01-29 16:34:26 +0000 |
---|---|---|
committer | Angelo Salese <angelosa@users.noreply.github.com> | 2012-01-29 16:34:26 +0000 |
commit | 505442d0a0bdc2944f699d9102ae0829703a5407 (patch) | |
tree | 1a4c2f72533c67984e0112d35905f480a3a9b0ea | |
parent | 5d0cb30e84215504e368130db9e4573c37e458f2 (diff) |
Clean-ups and version bumpmame0144u7
131 files changed, 2075 insertions, 2067 deletions
diff --git a/src/emu/audit.c b/src/emu/audit.c index bfc4466d977..97837a44487 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -234,7 +234,7 @@ media_auditor::summary media_auditor::audit_samples() int found = 0; // iterate over sample entries - samples_device_iterator iter(m_enumerator.config().root_device()); + samples_device_iterator iter(m_enumerator.config().root_device()); for (samples_device *device = iter.first(); device != NULL; device = iter.next()) { const samples_interface *intf = reinterpret_cast<const samples_interface *>(device->static_config()); diff --git a/src/emu/cpu/arm7/arm7ops.h b/src/emu/cpu/arm7/arm7ops.h index e797ae89056..56778963982 100644 --- a/src/emu/cpu/arm7/arm7ops.h +++ b/src/emu/cpu/arm7/arm7ops.h @@ -5,4 +5,4 @@ const void arm7ops_89(arm_state *cpustate, UINT32 insn); const void arm7ops_ab(arm_state *cpustate, UINT32 insn); const void arm7ops_cd(arm_state *cpustate, UINT32 insn); const void arm7ops_e(arm_state *cpustate, UINT32 insn); -const void arm7ops_f(arm_state *cpustate, UINT32 insn); +const void arm7ops_f(arm_state *cpustate, UINT32 insn); diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c index 2c4a6631cf4..0c9dcb9917c 100644 --- a/src/emu/cpu/i386/i386.c +++ b/src/emu/cpu/i386/i386.c @@ -1062,7 +1062,7 @@ static void i286_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested CHANGE_PC(cpustate,cpustate->eip); cpustate->CPL = cpustate->sreg[CS].selector & 0x03; -// printf("286 Task Switch from selector %04x to %04x\n",old_task,selector); +// printf("286 Task Switch from selector %04x to %04x\n",old_task,selector); } static void i386_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested) @@ -1177,7 +1177,7 @@ static void i386_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested CHANGE_PC(cpustate,cpustate->eip); cpustate->CPL = cpustate->sreg[CS].selector & 0x03; -// printf("386 Task Switch from selector %04x to %04x\n",old_task,selector); +// printf("386 Task Switch from selector %04x to %04x\n",old_task,selector); } static void i386_check_irq_line(i386_state *cpustate) diff --git a/src/emu/cpu/i386/i386op16.c b/src/emu/cpu/i386/i386op16.c index 20aa740a017..3e647024cdc 100644 --- a/src/emu/cpu/i386/i386op16.c +++ b/src/emu/cpu/i386/i386op16.c @@ -3277,7 +3277,7 @@ static void I386OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 case 2: /* LGDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); ea = i386_translate(cpustate, CS, address, 0 ); @@ -3292,7 +3292,7 @@ static void I386OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 case 3: /* LIDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); ea = i386_translate(cpustate, CS, address, 0 ); diff --git a/src/emu/cpu/i386/i386op32.c b/src/emu/cpu/i386/i386op32.c index a165f6f22a1..aa53fcfb1e0 100644 --- a/src/emu/cpu/i386/i386op32.c +++ b/src/emu/cpu/i386/i386op32.c @@ -3123,7 +3123,7 @@ static void I386OP(group0F01_32)(i386_state *cpustate) // Opcode 0x0f 01 case 2: /* LGDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM32(modrm); ea = i386_translate(cpustate, CS, address, 0 ); @@ -3138,7 +3138,7 @@ static void I386OP(group0F01_32)(i386_state *cpustate) // Opcode 0x0f 01 case 3: /* LIDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM32(modrm); ea = i386_translate(cpustate, CS, address, 0 ); diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h index 92467b7504c..35b29faba9e 100644 --- a/src/emu/cpu/i386/i386priv.h +++ b/src/emu/cpu/i386/i386priv.h @@ -458,7 +458,7 @@ INLINE int translate_address(i386_state *cpustate, int rwn, UINT32 *address, UIN if(!(page_dir & 0x40) && (rwn == 1)) cpustate->program->write_dword(pdbr + directory * 4, page_dir | 0x60); else if(!(page_dir & 0x20) && (rwn != -1)) - cpustate->program->write_dword(pdbr + directory * 4, page_dir | 0x20); + cpustate->program->write_dword(pdbr + directory * 4, page_dir | 0x20); *address = (page_dir & 0xffc00000) | (a & 0x003fffff); } } diff --git a/src/emu/cpu/i386/i486ops.c b/src/emu/cpu/i386/i486ops.c index b573fd09da0..8a5e86dfa14 100644 --- a/src/emu/cpu/i386/i486ops.c +++ b/src/emu/cpu/i386/i486ops.c @@ -241,7 +241,7 @@ static void I486OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 case 2: /* LGDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); ea = i386_translate( cpustate, CS, address, 0 ); @@ -256,7 +256,7 @@ static void I486OP(group0F01_16)(i386_state *cpustate) // Opcode 0x0f 01 case 3: /* LIDT */ { if(PROTECTED_MODE && cpustate->CPL) - FAULT(FAULT_GP,0) + FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); ea = i386_translate( cpustate, CS, address, 0 ); diff --git a/src/emu/cpu/i386/x87ops.c b/src/emu/cpu/i386/x87ops.c index 21e05057628..c6b9dc4bb85 100644 --- a/src/emu/cpu/i386/x87ops.c +++ b/src/emu/cpu/i386/x87ops.c @@ -2,17 +2,17 @@ x87 FPU emulation - TODO: - - 80-bit precision for F2XM1, FYL2X, FPATAN - - Figure out why SoftFloat trig extensions produce bad values - - Cycle counts for all processors (currently using 486 counts) - - Precision-dependent cycle counts for divide instructions - - Last instruction, operand pointers etc. - - Fix FLDENV, FSTENV, FSAVE, FRSTOR and FPREM - - Status word C2 updates to reflect round up/down - - Handling of invalid and denormal numbers - - Remove redundant operand checks - - Exceptions + TODO: + - 80-bit precision for F2XM1, FYL2X, FPATAN + - Figure out why SoftFloat trig extensions produce bad values + - Cycle counts for all processors (currently using 486 counts) + - Precision-dependent cycle counts for divide instructions + - Last instruction, operand pointers etc. + - Fix FLDENV, FSTENV, FSAVE, FRSTOR and FPREM + - Status word C2 updates to reflect round up/down + - Handling of invalid and denormal numbers + - Remove redundant operand checks + - Exceptions ***************************************************************************/ @@ -2167,7 +2167,7 @@ void x87_fptan(i386_state *cpustate, UINT8 modrm) double x = fx80_to_double(result1); x = tan(x); result1 = double_to_fx80(x); - + cpustate->x87_sw &= ~X87_SW_C2; #endif } @@ -2229,7 +2229,7 @@ void x87_fsin(i386_state *cpustate, UINT8 modrm) double x = fx80_to_double(result); x = sin(x); result = double_to_fx80(x); - + cpustate->x87_sw &= ~X87_SW_C2; #endif } @@ -2262,7 +2262,7 @@ void x87_fcos(i386_state *cpustate, UINT8 modrm) double x = fx80_to_double(result); x = cos(x); result = double_to_fx80(x); - + cpustate->x87_sw &= ~X87_SW_C2; #endif } @@ -2300,13 +2300,13 @@ void x87_fsincos(i386_state *cpustate, UINT8 modrm) cpustate->x87_sw |= X87_SW_C2; #else double s = fx80_to_double(s_result); - double c = fx80_to_double(c_result); + double c = fx80_to_double(c_result); s = sin(s); c = cos(c); - + s_result = double_to_fx80(s); c_result = double_to_fx80(c); - + cpustate->x87_sw &= ~X87_SW_C2; #endif } @@ -4023,38 +4023,38 @@ void x87_fstenv(i386_state *cpustate, UINT8 modrm) WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 2, cpustate->x87_sw); WRITE16(cpustate, ea + 4, cpustate->x87_tw); -// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); break; case 1: // 16-bit protected mode WRITE16(cpustate,ea + 0, cpustate->x87_cw); WRITE16(cpustate,ea + 2, cpustate->x87_sw); WRITE16(cpustate,ea + 4, cpustate->x87_tw); -// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); break; case 2: // 32-bit real mode WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 4, cpustate->x87_sw); WRITE16(cpustate, ea + 8, cpustate->x87_tw); -// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); +// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); break; case 3: // 32-bit protected mode WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 4, cpustate->x87_sw); WRITE16(cpustate, ea + 8, cpustate->x87_tw); -// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); -// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); -// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); -// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); +// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); +// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); break; } @@ -4072,41 +4072,41 @@ void x87_fsave(i386_state *cpustate, UINT8 modrm) WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 2, cpustate->x87_sw); WRITE16(cpustate, ea + 4, cpustate->x87_tw); -// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); ea += 14; break; case 1: // 16-bit protected mode WRITE16(cpustate,ea + 0, cpustate->x87_cw); WRITE16(cpustate,ea + 2, cpustate->x87_sw); WRITE16(cpustate,ea + 4, cpustate->x87_tw); -// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); ea += 14; break; case 2: // 32-bit real mode WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 4, cpustate->x87_sw); WRITE16(cpustate, ea + 8, cpustate->x87_tw); -// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); +// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); ea += 28; break; case 3: // 32-bit protected mode WRITE16(cpustate, ea + 0, cpustate->x87_cw); WRITE16(cpustate, ea + 4, cpustate->x87_sw); WRITE16(cpustate, ea + 8, cpustate->x87_tw); -// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); -// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); -// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); -// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); +// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); +// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); ea += 28; break; } @@ -4128,41 +4128,41 @@ void x87_frstor(i386_state *cpustate, UINT8 modrm) x87_write_cw(cpustate, READ16(cpustate, ea)); cpustate->x87_sw = READ16(cpustate, ea + 2); cpustate->x87_tw = READ16(cpustate, ea + 4); -// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate, ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); ea += 14; break; case 1: // 16-bit protected mode x87_write_cw(cpustate, READ16(cpustate, ea)); cpustate->x87_sw = READ16(cpustate, ea + 2); cpustate->x87_tw = READ16(cpustate, ea + 4); -// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); +// WRITE16(cpustate,ea + 6, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate,ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate,ea + 10, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate,ea + 12, (cpustate->fpu_inst_ptr & 0x0f0000) >> 4); ea += 14; break; case 2: // 32-bit real mode x87_write_cw(cpustate, READ16(cpustate, ea)); cpustate->x87_sw = READ16(cpustate, ea + 4); cpustate->x87_tw = READ16(cpustate, ea + 8); -// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); -// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); -// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); -// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); +// WRITE16(cpustate, ea + 12, cpustate->fpu_inst_ptr & 0xffff); +// WRITE16(cpustate, ea + 8, (cpustate->fpu_opcode & 0x07ff) | ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE16(cpustate, ea + 20, cpustate->fpu_data_ptr & 0xffff); +// WRITE16(cpustate, ea + 12, ((cpustate->fpu_inst_ptr & 0x0f0000) >> 4)); +// WRITE32(cpustate, ea + 24, (cpustate->fpu_data_ptr >> 16) << 12); ea += 28; break; case 3: // 32-bit protected mode x87_write_cw(cpustate, READ16(cpustate, ea)); cpustate->x87_sw = READ16(cpustate, ea + 4); cpustate->x87_tw = READ16(cpustate, ea + 8); -// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); -// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); -// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); -// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 12, cpustate->fpu_inst_ptr); +// WRITE32(cpustate, ea + 16, cpustate->fpu_opcode); +// WRITE32(cpustate, ea + 20, cpustate->fpu_data_ptr); +// WRITE32(cpustate, ea + 24, cpustate->fpu_inst_ptr); ea += 28; break; } diff --git a/src/emu/device.c b/src/emu/device.c index c9c83b12cbd..abe467f1122 100644 --- a/src/emu/device.c +++ b/src/emu/device.c @@ -110,7 +110,7 @@ device_t::device_t(const machine_config &mconfig, device_type type, const char * m_clock(clock), m_clock_scale(1.0), m_attoseconds_per_clock((clock == 0) ? 0 : HZ_TO_ATTOSECONDS(clock)), - + m_debug(NULL), m_region(NULL), m_machine_config(mconfig), @@ -148,7 +148,7 @@ device_t::device_t(const machine_config &mconfig, device_type type, const char * m_clock(clock), m_clock_scale(1.0), m_attoseconds_per_clock((clock == 0) ? 0 : HZ_TO_ATTOSECONDS(clock)), - + m_debug(NULL), m_region(NULL), m_machine_config(mconfig), @@ -262,11 +262,11 @@ void device_t::reset() // reset the device device_reset(); - + // reset all child devices for (device_t *child = m_subdevice_list.first(); child != NULL; child = child->next()) child->reset(); - + // now allow for some post-child reset action device_reset_after_children(); @@ -695,7 +695,7 @@ device_t *device_t::subdevice_slow(const char *tag) const if (part == curdevice->m_basetag) break; } - + // if we got a match, add to the fast map if (curdevice != NULL) { @@ -719,7 +719,7 @@ astring &device_t::subtag(astring &result, const char *tag) const tag++; result.cpy(":"); } - + // otherwise, start with our path else { @@ -735,12 +735,12 @@ astring &device_t::subtag(astring &result, const char *tag) const // copy everything up to there result.cat(tag, caret - tag); tag = caret + 1; - + // strip trailing colons int len = result.len(); while (result[--len] == ':') result.substr(0, len); - + // remove the last path part, leaving the last colon if (result != ":") { @@ -792,7 +792,7 @@ device_t *device_t::replace_subdevice(device_t &old, device_type type, const cha for (device_t *scan = iter.first(); scan != NULL; scan = iter.next()) scan->m_device_map.remove(&old); - // create a new device, and substitute it for the old one + // create a new device, and substitute it for the old one device_t *device = (*type)(mconfig(), tag, this, clock); m_subdevice_list.replace_and_remove(*device, old); diff --git a/src/emu/device.h b/src/emu/device.h index b4fbd163cb3..f2c6950b45c 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -470,7 +470,7 @@ public: m_current(NULL), m_curdepth(0), m_maxdepth(maxdepth) { } - + // getters device_t *current() const { return m_current; } @@ -480,7 +480,7 @@ public: // reset and return first item device_t *first() { - m_current = m_root; + m_current = m_root; return m_current; } @@ -502,7 +502,7 @@ public: return m_current; } } - + // search next for neighbors up the ownership chain while (m_curdepth > 0) { @@ -511,24 +511,24 @@ public: if (m_current != NULL) return m_current; - // no? try our parent + // no? try our parent start = start->owner(); m_curdepth--; } - + // returned to the top; we're done return m_current = NULL; } - + // return the number of items available int count() { - int result = 0; + int result = 0; for (device_t *item = first(); item != NULL; item = next()) result++; return result; } - + // return the index of a given item in the virtual list int indexof(device_t &device) { @@ -591,16 +591,16 @@ public: return downcast<_DeviceClass *>(device); return NULL; } - + // return the number of items available int count() { - int result = 0; + int result = 0; for (_DeviceClass *item = first(); item != NULL; item = next()) result++; return result; } - + // return the index of a given item in the virtual list int indexof(_DeviceClass &device) { @@ -641,7 +641,7 @@ public: // getters _InterfaceClass *current() const { return m_current; } - + // setters void set_current(_InterfaceClass ¤t) { m_current = ¤t; m_iterator.set_current(current.device()); } @@ -662,16 +662,16 @@ public: return m_current; return NULL; } - + // return the number of items available int count() { - int result = 0; + int result = 0; for (_InterfaceClass *item = first(); item != NULL; item = next()) result++; return result; } - + // return the index of a given item in the virtual list int indexof(_InterfaceClass &intrf) { @@ -755,7 +755,7 @@ inline device_t *device_t::subdevice(const char *tag) const //------------------------------------------------- -// siblingdevice - given a tag, find the device +// siblingdevice - given a tag, find the device // by name relative to this device's parent //------------------------------------------------- @@ -768,7 +768,7 @@ inline device_t *device_t::siblingdevice(const char *tag) const // empty string or NULL means this device if (tag == NULL || *tag == 0) return const_cast<device_t *>(this); - + // leading caret implies the owner, just skip it if (tag[0] == '^') tag++; diff --git a/src/emu/diimage.h b/src/emu/diimage.h index 84fafc69952..299a3010006 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -333,7 +333,7 @@ public: virtual ~ui_menu_control_device_image(); virtual void populate(); virtual void handle(); - + protected: enum { START_FILE, START_OTHER_PART, START_SOFTLIST, SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART, SELECT_FILE, CREATE_FILE, CREATE_CONFIRM, DO_CREATE, SELECT_SOFTLIST, diff --git a/src/emu/emutempl.h b/src/emu/emutempl.h index 413e2cacbbb..70a709b1c0d 100644 --- a/src/emu/emutempl.h +++ b/src/emu/emutempl.h @@ -59,7 +59,7 @@ class simple_list public: // construction/destruction - simple_list(resource_pool &pool = global_resource_pool()) + simple_list(resource_pool &pool = global_resource_pool()) : m_head(NULL), m_tail(NULL), m_pool(pool), diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c index 2e4d9593a62..41f57584cab 100644 --- a/src/emu/imagedev/floppy.c +++ b/src/emu/imagedev/floppy.c @@ -203,7 +203,7 @@ floppy_image_format_t *floppy_image_device::identify(astring filename) const fd = fopen(filename.cstr(), "r"); if(!fd) return 0; - + io_generic io; io.file = fd; io.procs = &stdio_ioprocs_noclose; @@ -610,12 +610,12 @@ ui_menu *floppy_image_device::get_selection_menu(running_machine &machine, rende ui_menu_control_floppy_image::ui_menu_control_floppy_image(running_machine &machine, render_container *container, device_image_interface *_image) : ui_menu_control_device_image(machine, container, _image) { - floppy_image_device *fd = static_cast<floppy_image_device *>(image); + floppy_image_device *fd = static_cast<floppy_image_device *>(image); const floppy_image_format_t *fif_list = fd->get_formats(); int fcnt = 0; for(const floppy_image_format_t *i = fif_list; i; i = i->next) fcnt++; - + format_array = global_alloc_array(floppy_image_format_t *, fcnt); input_format = output_format = 0; input_filename = output_filename = ""; @@ -628,7 +628,7 @@ ui_menu_control_floppy_image::~ui_menu_control_floppy_image() void ui_menu_control_floppy_image::do_load_create() { - floppy_image_device *fd = static_cast<floppy_image_device *>(image); + floppy_image_device *fd = static_cast<floppy_image_device *>(image); if(input_filename == "") { int err = fd->create(output_filename, 0, NULL); if (err != 0) { @@ -678,7 +678,7 @@ void ui_menu_control_floppy_image::hook_load(astring filename, bool softlist) void ui_menu_control_floppy_image::handle() { - floppy_image_device *fd = static_cast<floppy_image_device *>(image); + floppy_image_device *fd = static_cast<floppy_image_device *>(image); switch(state) { case DO_CREATE: { floppy_image_format_t *fif_list = fd->get_formats(); diff --git a/src/emu/machine.c b/src/emu/machine.c index 2206628b4e4..88ad95b27d9 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -915,7 +915,7 @@ void running_machine::start_all_devices() failed_starts++; } } - + // each iteration should reduce the number of failed starts; error if // this doesn't happen if (failed_starts == last_failed_starts) @@ -954,12 +954,12 @@ void running_machine::stop_all_devices() device->stop(); // then nuke the device tree -// global_free(m_root_device); +// global_free(m_root_device); } //------------------------------------------------- -// presave_all_devices - tell all the devices we +// presave_all_devices - tell all the devices we // are about to save //------------------------------------------------- @@ -972,7 +972,7 @@ void running_machine::presave_all_devices() //------------------------------------------------- -// postload_all_devices - tell all the devices we +// postload_all_devices - tell all the devices we // just completed a load //------------------------------------------------- @@ -1266,7 +1266,7 @@ void driver_device::device_start() //------------------------------------------------- -// device_reset_after_children - device override +// device_reset_after_children - device override // which calls the various helpers; must happen // after all child devices are reset //------------------------------------------------- diff --git a/src/emu/machine.h b/src/emu/machine.h index ba99c76534b..f4878516ff8 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -444,7 +444,7 @@ private: void fill_systime(system_time &systime, time_t t); void handle_saveload(); void soft_reset(void *ptr = NULL, INT32 param = 0); - + // internal callbacks static void logfile_callback(running_machine &machine, const char *buffer); diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c index 4bb2eae5bad..970e61cba89 100644 --- a/src/emu/machine/6522via.c +++ b/src/emu/machine/6522via.c @@ -27,14 +27,14 @@ #include "devhelpr.h" /*************************************************************************** - PARAMETERS + PARAMETERS ***************************************************************************/ #define TRACE_VIA 0 /*************************************************************************** - MACROS + MACROS ***************************************************************************/ /* Macros for PCR */ @@ -106,7 +106,7 @@ /*************************************************************************** - INLINE FUNCTIONS + INLINE FUNCTIONS ***************************************************************************/ inline void via6522_device::set_irq_line(int state) @@ -578,7 +578,7 @@ READ8_MEMBER( via6522_device::read ) CLR_PA_INT(); /* If CA2 is configured as output and in pulse or handshake mode, - CA2 is set now */ + CA2 is set now */ if (CA2_PULSE_OUTPUT(m_pcr)) { /* call the CA2 output function */ @@ -742,7 +742,7 @@ WRITE8_MEMBER( via6522_device::write ) CLR_PB_INT(); /* If CB2 is configured as output and in pulse or handshake mode, - CB2 is set now */ + CB2 is set now */ if (CB2_AUTO_HS(m_pcr)) { if (m_out_cb2) @@ -1015,7 +1015,7 @@ WRITE_LINE_MEMBER( via6522_device::write_ca1 ) set_int(INT_CA1); /* CA2 is configured as output and in pulse or handshake mode, - CA2 is cleared now */ + CA2 is cleared now */ if (CA2_AUTO_HS(m_pcr)) { if (!m_out_ca2) @@ -1089,7 +1089,7 @@ WRITE_LINE_MEMBER( via6522_device::write_cb1 ) set_int(INT_CB1); /* CB2 is configured as output and in pulse or handshake mode, - CB2 is cleared now */ + CB2 is cleared now */ if (CB2_AUTO_HS(m_pcr)) { if (!m_out_cb2) diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c index a62e175b808..3d90dcad6fd 100644 --- a/src/emu/machine/generic.c +++ b/src/emu/machine/generic.c @@ -320,7 +320,7 @@ static astring &nvram_filename(astring &result, device_t &device) { running_machine &machine = device.machine(); - // start with either basename or basename_biosnum + // start with either basename or basename_biosnum result.cpy(machine.basename()); if (rom_system_bios(machine) != 0 && rom_default_bios(machine) != rom_system_bios(machine)) result.catprintf("_%d", rom_system_bios(machine) - 1); diff --git a/src/emu/machine/im6402.c b/src/emu/machine/im6402.c index 6ceb337803a..9e03a188fd8 100644 --- a/src/emu/machine/im6402.c +++ b/src/emu/machine/im6402.c @@ -38,7 +38,7 @@ const device_type IM6402 = &device_creator<im6402_device>; inline void im6402_device::set_dr(int state) { m_dr = state; - + m_out_dr_func(state); } @@ -50,7 +50,7 @@ inline void im6402_device::set_dr(int state) inline void im6402_device::set_tbre(int state) { m_tbre = state; - + m_out_tbre_func(state); } @@ -62,7 +62,7 @@ inline void im6402_device::set_tbre(int state) inline void im6402_device::set_tre(int state) { m_tre = state; - + m_out_tre_func(state); } @@ -86,12 +86,12 @@ inline void im6402_device::receive() { receive_register_extract(); m_rbr = get_received_char(); - + if (m_dr) { m_oe = 1; } - + set_dr(ASSERT_LINE); } } @@ -106,18 +106,18 @@ inline void im6402_device::transmit() if (is_transmit_register_empty() && !m_tbre) { transmit_register_setup(m_tbr); - + set_tbre(ASSERT_LINE); set_tre(CLEAR_LINE); } - + if (!is_transmit_register_empty()) { int bit = transmit_register_get_data_bit(); - + m_out_tro_func(bit); serial_connection_out(); - + if (is_transmit_register_empty()) { set_tre(ASSERT_LINE); @@ -226,7 +226,7 @@ void im6402_device::device_reset() m_pe = 0; m_fe = 0; m_oe = 0; - + set_dr(CLEAR_LINE); set_tbre(ASSERT_LINE); set_tre(ASSERT_LINE); @@ -292,7 +292,7 @@ WRITE_LINE_MEMBER( im6402_device::rrc_w ) if (state) { m_rrc_count++; - + if (m_rrc_count == 16) { receive(); @@ -311,13 +311,13 @@ WRITE_LINE_MEMBER( im6402_device::trc_w ) if (state) { m_trc_count++; - + if (m_trc_count == 16) { transmit(); m_trc_count = 0; } - } + } } @@ -436,11 +436,11 @@ WRITE_LINE_MEMBER( im6402_device::crl_w ) int word_length = 5 + ((m_cls2 << 1) | m_cls1); int stop_bits = 1 + m_sbs ? ((word_length == 5) ? 0.5 : 1) : 0; int parity_code; - - if (m_pi) parity_code = SERIAL_PARITY_NONE; - else if (m_epe) parity_code = SERIAL_PARITY_EVEN; + + if (m_pi) parity_code = SERIAL_PARITY_NONE; + else if (m_epe) parity_code = SERIAL_PARITY_EVEN; else parity_code = SERIAL_PARITY_ODD; - + set_data_frame(word_length, stop_bits, parity_code); } } diff --git a/src/emu/machine/im6402.h b/src/emu/machine/im6402.h index a9575b225d1..254fa8027ce 100644 --- a/src/emu/machine/im6402.h +++ b/src/emu/machine/im6402.h @@ -29,12 +29,12 @@ RRI 20 |_____________| 21 MR - NOTE: PIN IM6402 IM6403 - --------------------------- - 2 N/C CONTROL - 17 RRC OSC IN - 40 TRC OSC OUT - + NOTE: PIN IM6402 IM6403 + --------------------------- + 2 N/C CONTROL + 17 RRC OSC IN + 40 TRC OSC OUT + ***************************************************************************/ #pragma once @@ -70,7 +70,7 @@ struct im6402_interface { int m_rrc; int m_trc; - + devcb_read_line m_in_rri_cb; devcb_write_line m_out_tro_cb; devcb_write_line m_out_dr_cb; @@ -81,7 +81,7 @@ struct im6402_interface // ======================> im6402_device -class im6402_device : public device_t, +class im6402_device : public device_t, public device_serial_interface, public im6402_interface { @@ -91,7 +91,7 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - + DECLARE_READ_LINE_MEMBER( dr_r ); DECLARE_READ_LINE_MEMBER( tbre_r ); DECLARE_READ_LINE_MEMBER( tre_r ); @@ -118,7 +118,7 @@ protected: virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - + // device_serial_interface overrides virtual void input_callback(UINT8 state); @@ -128,7 +128,7 @@ private: inline void set_tre(int state); inline void receive(); inline void transmit(); - + static const device_timer_id TIMER_RX = 0; static const device_timer_id TIMER_TX = 1; @@ -145,7 +145,7 @@ private: int m_pe; int m_fe; int m_oe; - + // control int m_cls1; int m_cls2; @@ -153,15 +153,15 @@ private: int m_sfd; int m_epe; int m_pi; - + // receiver UINT8 m_rbr; int m_rrc_count; - + // transmitter UINT8 m_tbr; int m_trc_count; - + // timers emu_timer *m_rx_timer; emu_timer *m_tx_timer; diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c index 05f372aa6e9..b7b51667007 100644 --- a/src/emu/machine/scsihd.c +++ b/src/emu/machine/scsihd.c @@ -257,17 +257,17 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr // Attempt to register save state entry after state registration is closed! state_save_register_item( machine, "scsihd", diskregion, 0, our_this->lba ); state_save_register_item( machine, "scsihd", diskregion, 0, our_this->blocks ); - + // try to locate the CHD from a DISK_REGION our_this->handle = get_disk_handle(machine, diskregion); our_this->disk = hard_disk_open(our_this->handle); our_this->is_image_device = false; - + if (our_this->disk == NULL) { // try to locate the CHD from an image device harddisk_image_device *image_device = machine.device<harddisk_image_device>(diskregion); - + if (image_device != NULL) { our_this->handle = image_device->get_chd_file(); @@ -275,7 +275,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr our_this->is_image_device = true; } } - + if (our_this->disk == NULL) { // try to locate the CHD from an image subdevice @@ -290,7 +290,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr } } } - + if (our_this->disk != NULL) { // get hard disk sector size from CHD metadata diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c index 95ef6ec936c..313754e4f16 100644 --- a/src/emu/mconfig.c +++ b/src/emu/mconfig.c @@ -80,10 +80,10 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options) if (!options.exists(owner.tag()+1)) selval = slot->get_default_card(*this, options); - if (selval != NULL && strlen(selval) != 0) + if (selval != NULL && strlen(selval) != 0) { bool found = false; - for (int i = 0; intf[i].name != NULL; i++) + for (int i = 0; intf[i].name != NULL; i++) { if (strcmp(selval, intf[i].name) == 0) { @@ -143,7 +143,7 @@ device_t *machine_config::device_add(device_t *owner, const char *tag, device_ty // if there's an owner, let the owner do the work if (owner != NULL) return owner->add_subdevice(type, tag, clock); - + // otherwise, allocate the device directly assert(m_root_device == NULL); m_root_device = (*type)(*this, tag, owner, clock); @@ -171,7 +171,7 @@ device_t *machine_config::device_replace(device_t *owner, const char *tag, devic mame_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag); return device_add(owner, tag, type, clock); } - + // let the device's owner do the work return device->owner()->replace_subdevice(*device, type, tag, clock); } diff --git a/src/emu/memory.c b/src/emu/memory.c index 521eb09d871..292f6b71149 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -2233,7 +2233,7 @@ void address_space::prepare_map() // determine full tag astring fulltag; device().siblingtag(fulltag, entry->m_region); - + // set the memory address entry->m_memory = machine().region(fulltag.cstr())->base() + entry->m_rgnoffs; } diff --git a/src/emu/render.h b/src/emu/render.h index 980816300fe..8171d4b6145 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -190,7 +190,7 @@ struct render_bounds float y0; // topmost Y coordinate float x1; // rightmost X coordinate float y1; // bottommost Y coordinate - + float width() const { return x1 - x0; } float height() const { return y1 - y0; } }; diff --git a/src/emu/romload.c b/src/emu/romload.c index efb2858ca0a..d8379bbcda9 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -154,7 +154,7 @@ file_error common_process_file(emu_options &options, const char *location, bool chd_file *get_disk_handle(running_machine &machine, const char *region) { - for (open_chd *curdisk = machine.romload_data->chd_list.first(); curdisk != NULL; curdisk = curdisk->next()) + for (open_chd *curdisk = machine.romload_data->chd_list.first(); curdisk != NULL; curdisk = curdisk->next()) if (strcmp(curdisk->region(), region) == 0) return curdisk->chd(); return NULL; diff --git a/src/emu/screen.c b/src/emu/screen.c index 241532fab90..65d904e84b3 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -430,8 +430,8 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a assert(height > 0); assert(visarea.min_x >= 0); assert(visarea.min_y >= 0); -// assert(visarea.max_x < width); -// assert(visarea.max_y < height); +// assert(visarea.max_x < width); +// assert(visarea.max_y < height); assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_x < width); assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_y < height); assert(frame_period > 0); @@ -509,7 +509,7 @@ void screen_device::realloc_screen_bitmaps() // doesn't apply for vector games if (m_type == SCREEN_TYPE_VECTOR) return; - + // determine effective size to allocate INT32 effwidth = MAX(m_width, m_visarea.max_x + 1); INT32 effheight = MAX(m_height, m_visarea.max_y + 1); diff --git a/src/emu/softlist.h b/src/emu/softlist.h index 6c8b5af041e..d4391e812c8 100644 --- a/src/emu/softlist.h +++ b/src/emu/softlist.h @@ -60,12 +60,12 @@ public: // inline configuration helpers static void static_set_config(device_t &device, const char *list, softlist_type list_type); static void static_set_filter(device_t &device, const char *filter); - + // getters const char *list_name() const { return m_list_name; } softlist_type list_type() const { return m_list_type; } const char *filter() const { return m_filter; } - + // validation helpers static void reset_checked_lists() { s_checked_lists.reset(); } @@ -76,9 +76,9 @@ protected: // configuration state const char * m_list_name; - softlist_type m_list_type; + softlist_type m_list_type; const char * m_filter; - + // static state static tagmap_t<UINT8> s_checked_lists; }; diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c index 35847f654b8..55641d1c7a6 100644 --- a/src/emu/sound/samples.c +++ b/src/emu/sound/samples.c @@ -124,7 +124,7 @@ FLAC__StreamDecoderReadStatus my_read_callback(const FLAC__StreamDecoder *decode } -FLAC__StreamDecoderWriteStatus my_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) +FLAC__StreamDecoderWriteStatus my_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) { //printf("my_write_callback\n"); //printf("array size %d\n",frame->header.blocksize); @@ -140,7 +140,7 @@ FLAC__StreamDecoderWriteStatus my_write_callback(const FLAC__StreamDecoder *deco } flacrd->write_position += frame->header.blocksize; - + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } @@ -328,7 +328,7 @@ static int read_wav_sample(running_machine &machine, emu_file &file, loaded_samp return 0; int size = flacread.total_samples * (flacread.bits_per_sample/8); - + sample->data = auto_alloc_array(machine, INT16, size); flacread.write_position = 0; flacread.write_data = sample->data; @@ -342,7 +342,7 @@ static int read_wav_sample(running_machine &machine, emu_file &file, loaded_samp FLAC__stream_decoder_delete(decoder); /* fill in the sample data */ - + sample->frequency = flacread.sample_rate; sample->length = size; diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c index 31e12cc6b48..ab0ee1f5e96 100644 --- a/src/emu/tilemap.c +++ b/src/emu/tilemap.c @@ -446,7 +446,7 @@ tilemap_t::~tilemap_t() //------------------------------------------------- -// mark_tile_dirty - mark a single tile dirty +// mark_tile_dirty - mark a single tile dirty // based on its memory index //------------------------------------------------- @@ -467,8 +467,8 @@ void tilemap_t::mark_tile_dirty(tilemap_memory_index memindex) //------------------------------------------------- -// map_pens_to_layer - specify the mapping of one -// or more pens (where (<pen> & mask) == pen) to +// map_pens_to_layer - specify the mapping of one +// or more pens (where (<pen> & mask) == pen) to // a layer //------------------------------------------------- @@ -503,8 +503,8 @@ void tilemap_t::map_pens_to_layer(int group, pen_t pen, pen_t mask, UINT8 layerm //------------------------------------------------- -// set_transparent_pen - set a single transparent -// pen into the tilemap, mapping all other pens +// set_transparent_pen - set a single transparent +// pen into the tilemap, mapping all other pens // to layer 0 //------------------------------------------------- @@ -519,8 +519,8 @@ void tilemap_t::set_transparent_pen(pen_t pen) //------------------------------------------------- -// set_transmask - set up the first 32 pens using -// a foreground mask (mapping to layer 0) and a +// set_transmask - set up the first 32 pens using +// a foreground mask (mapping to layer 0) and a // background mask (mapping to layer 1) //------------------------------------------------- @@ -601,7 +601,7 @@ TILEMAP_MAPPER( tilemap_scan_cols_flip_xy ) //------------------------------------------------- -// postload - after loading a save state +// postload - after loading a save state // invalidate everything //------------------------------------------------- @@ -918,7 +918,7 @@ void tilemap_t::configure_blit_parameters(blit_parameters &blit, const rectangle //------------------------------------------------- -// draw_common - draw a tilemap to the +// draw_common - draw a tilemap to the // destination with clipping; pixels apply // priority/priority_mask to the priority bitmap //------------------------------------------------- @@ -1037,9 +1037,9 @@ void tilemap_t::draw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 flags //------------------------------------------------- -// draw_roz - draw a tilemap to the destination -// with clipping and arbitrary rotate/zoom; pixels -// apply priority/priority_mask to the priority +// draw_roz - draw a tilemap to the destination +// with clipping and arbitrary rotate/zoom; pixels +// apply priority/priority_mask to the priority // bitmap //------------------------------------------------- @@ -1090,8 +1090,8 @@ void tilemap_t::draw_roz(bitmap_rgb32 &dest, const rectangle &cliprect, //------------------------------------------------- -// draw_instance - draw a single instance of the -// tilemap to the internal pixmap at the given +// draw_instance - draw a single instance of the +// tilemap to the internal pixmap at the given // xpos,ypos //------------------------------------------------- @@ -1481,7 +1481,7 @@ tilemap_manager::tilemap_manager(running_machine &machine) //------------------------------------------------- -// set_flip_all - set a global flip for all the +// set_flip_all - set a global flip for all the // tilemaps //------------------------------------------------- @@ -1497,7 +1497,7 @@ tilemap_t &tilemap_manager::create(tile_get_info_func tile_get_info, tilemap_map //------------------------------------------------- -// set_flip_all - set a global flip for all the +// set_flip_all - set a global flip for all the // tilemaps //------------------------------------------------- @@ -1509,7 +1509,7 @@ void tilemap_manager::set_flip_all(UINT32 attributes) //------------------------------------------------- -// mark_all_dirty - mark all the tiles in all the +// mark_all_dirty - mark all the tiles in all the // tilemaps dirty //------------------------------------------------- diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index 956a3fc95f5..192f2879eda 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -419,7 +419,7 @@ typedef tilemap_memory_index (*tilemap_mapper_func)(running_machine &machine, UI class tilemap_t { DISABLE_COPYING(tilemap_t); - + friend class tilemap_manager; friend class simple_list<tilemap_t>; friend resource_pool_object<tilemap_t>::~resource_pool_object(); @@ -455,7 +455,7 @@ public: bitmap_ind8 &flagsmap() { pixmap_update(); return m_flagsmap; } UINT8 *tile_flags() { pixmap_update(); return m_tileflags; } tilemap_memory_index memory_index(UINT32 col, UINT32 row) { return m_mapper(col, row, m_cols, m_rows); } - + // setters void enable(bool enable = true) { m_enable = enable; } void set_user_data(void *user_data) { m_user_data = user_data; } @@ -505,12 +505,12 @@ private: UINT8 value; UINT8 alpha; }; - + // inline helpers INT32 effective_rowscroll(int index, UINT32 screen_width); INT32 effective_colscroll(int index, UINT32 screen_height); bool gfx_elements_changed(); - + // inline scanline rasterizers void scanline_draw_opaque_null(int count, UINT8 *pri, UINT32 pcode); void scanline_draw_masked_null(const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); @@ -600,10 +600,10 @@ class tilemap_manager public: // construction/destuction tilemap_manager(running_machine &machine); - + // getters running_machine &machine() const { return m_machine; } - + // tilemap creation tilemap_t &create(tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, int tilewidth, int tileheight, int cols, int rows); tilemap_t &create(tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows); @@ -622,7 +622,7 @@ private: // internal state running_machine & m_machine; - simple_list<tilemap_t> m_tilemap_list; + simple_list<tilemap_t> m_tilemap_list; int m_instance; }; @@ -643,7 +643,7 @@ private: // function definition for a logical-to-memory mapper #define TILEMAP_MAPPER(_name) tilemap_memory_index _name(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) -// useful macro inside of a TILE_GET_INFO callback to set tile information +// useful macro inside of a TILE_GET_INFO callback to set tile information #define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo.set(machine, GFX, CODE, COLOR, FLAGS) #define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo.set(device->machine(), GFX, CODE, COLOR, FLAGS) diff --git a/src/emu/validity.c b/src/emu/validity.c index d33c033b1b4..0ee812df39f 100644 --- a/src/emu/validity.c +++ b/src/emu/validity.c @@ -72,7 +72,7 @@ extern int m_device_count; //************************************************************************** //------------------------------------------------- -// ioport_string_from_index - return an indexed +// ioport_string_from_index - return an indexed // string from the I/O port system //------------------------------------------------- @@ -200,13 +200,13 @@ void validity_checker::check_shared_source(const game_driver &driver) { // initialize validate_begin(); - + // then iterate over all drivers and check the ones that share the same source file m_drivlist.reset(); while (m_drivlist.next()) if (strcmp(driver.source_file, m_drivlist.driver().source_file) == 0) validate_one(m_drivlist.driver()); - + // cleanup validate_end(); } @@ -222,20 +222,20 @@ void validity_checker::check_all() validate_begin(); validate_core(); validate_inlines(); - + // then iterate over all drivers and check them m_drivlist.reset(); while (m_drivlist.next()) validate_one(m_drivlist.driver()); - + // cleanup validate_end(); } //------------------------------------------------- -// validate_begin - prepare for validation by -// taking over the output callbacks and resetting +// validate_begin - prepare for validation by +// taking over the output callbacks and resetting // our internal state //------------------------------------------------- @@ -244,25 +244,25 @@ void validity_checker::validate_begin() // take over error and warning outputs m_saved_error_output = mame_set_output_channel(OUTPUT_CHANNEL_ERROR, output_delegate(FUNC(validity_checker::error_output), this)); m_saved_warning_output = mame_set_output_channel(OUTPUT_CHANNEL_WARNING, output_delegate(FUNC(validity_checker::warning_output), this)); - + // reset all our maps m_names_map.reset(); m_descriptions_map.reset(); m_roms_map.reset(); m_defstr_map.reset(); m_region_map.reset(); - + // reset internal state m_errors = 0; m_warnings = 0; - + // reset some special case state software_list_device::reset_checked_lists(); } //------------------------------------------------- -// validate_end - restore output callbacks and +// validate_end - restore output callbacks and // clean up //------------------------------------------------- @@ -286,7 +286,7 @@ void validity_checker::validate_one(const game_driver &driver) m_current_device = NULL; m_current_ioport = NULL; m_region_map.reset(); - + // reset error/warning state int start_errors = m_errors; int start_warnings = m_warnings; @@ -314,7 +314,7 @@ void validity_checker::validate_one(const game_driver &driver) mame_printf_error("Fatal error %s", err.string()); } m_current_config = NULL; - + // if we had warnings or errors, output if (m_errors > start_errors || m_warnings > start_warnings) { @@ -625,7 +625,7 @@ void validity_checker::validate_roms() { // for non-root devices, track the current device m_current_device = (source == &m_current_config->root_device()) ? NULL : source; - + // scan the ROM entries for this device const char *last_region_name = "???"; const char *last_name = "???"; @@ -660,7 +660,7 @@ void validity_checker::validate_roms() // generate the full tag astring fulltag; rom_region_name(fulltag, m_current_driver, source, romp); - + // attempt to add it to the map, reporting duplicates as errors current_length = ROMREGION_GETLENGTH(romp); if (m_region_map.add(fulltag, current_length, false) == TMERR_DUPLICATE) @@ -807,7 +807,7 @@ void validity_checker::validate_gfx() int xscale = (m_current_config->m_gfxdecodeinfo[gfxnum].xscale == 0) ? 1 : m_current_config->m_gfxdecodeinfo[gfxnum].xscale; int yscale = (m_current_config->m_gfxdecodeinfo[gfxnum].yscale == 0) ? 1 : m_current_config->m_gfxdecodeinfo[gfxnum].yscale; - + // verify raw decode, which can only be full-region and have no scaling if (layout.planeoffset[0] == GFX_RAW) { @@ -816,7 +816,7 @@ void validity_checker::validate_gfx() if (xscale != 1 || yscale != 1) mame_printf_error("gfx[%d] with unsupported xscale/yscale\n", gfxnum); } - + // verify traditional decode doesn't have too many planes or is not too large else { @@ -989,7 +989,7 @@ void validity_checker::validate_condition(input_condition &condition, device_t & // resolve the tag astring porttag; device.subtag(porttag, condition.tag); - + // then find a matching port if (port_map.find(porttag) == 0) mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag); @@ -1019,7 +1019,7 @@ void validity_checker::validate_inputs() ioport_list portlist; astring errorbuf; input_port_list_init(*device, portlist, errorbuf); - + // report any errors during construction if (errorbuf) mame_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr()); @@ -1084,7 +1084,7 @@ void validity_checker::validate_inputs() if (setting->condition.tag != NULL) validate_condition(setting->condition, *device, port_map); } - + // done with this port m_current_ioport = NULL; } @@ -1149,7 +1149,7 @@ void validity_checker::validate_slots() // instantiate the device device_t *dev = (*intf[j].devtype)(*m_current_config, "dummy", &m_current_config->root_device(), 0); dev->config_complete(); - + // if a ROM region is present if (dev->rom_region() != NULL) { @@ -1161,7 +1161,7 @@ void validity_checker::validate_slots() break; } - if (has_romfiles) + if (has_romfiles) { // scan the list of devices for this device type bool found = false; @@ -1184,7 +1184,7 @@ void validity_checker::validate_slots() //------------------------------------------------- -// build_output_prefix - create a prefix +// build_output_prefix - create a prefix // indicating the current source file, driver, // and device //------------------------------------------------- @@ -1193,11 +1193,11 @@ void validity_checker::build_output_prefix(astring &string) { // start empty string.reset(); - + // if we have a current device, indicate that if (m_current_device != NULL) string.cat(m_current_device->name()).cat(" device '").cat(m_current_device->tag()).cat("': "); - + // if we have a current port, indicate that as well if (m_current_ioport != NULL) string.cat("ioport '").cat(m_current_ioport).cat("': "); @@ -1212,7 +1212,7 @@ void validity_checker::error_output(const char *format, va_list argptr) { // count the error m_errors++; - + // output the source(driver) device 'tag' astring output; build_output_prefix(output); @@ -1224,7 +1224,7 @@ void validity_checker::error_output(const char *format, va_list argptr) //------------------------------------------------- -// warning_output - warning message output +// warning_output - warning message output // override //------------------------------------------------- @@ -1232,7 +1232,7 @@ void validity_checker::warning_output(const char *format, va_list argptr) { // count the error m_warnings++; - + // output the source(driver) device 'tag' astring output; build_output_prefix(output); diff --git a/src/emu/validity.h b/src/emu/validity.h index d362e155a1e..63854910bd7 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -63,18 +63,18 @@ class validity_checker public: validity_checker(emu_options &options); - // getters + // getters int errors() const { return m_errors; } int warnings() const { return m_warnings; } - // operations + // operations void check_driver(const game_driver &driver); void check_shared_source(const game_driver &driver); void check_all(); // helpers for devices void validate_tag(const char *tag); - + private: // internal helpers const char *ioport_string_from_index(UINT32 index); @@ -84,7 +84,7 @@ private: void validate_begin(); void validate_end(); void validate_one(const game_driver &driver); - + // internal sub-checks void validate_core(); void validate_inlines(); @@ -106,8 +106,8 @@ private: void output_via_delegate(output_delegate &delegate, const char *format, ...); // internal driver list - driver_enumerator m_drivlist; - + driver_enumerator m_drivlist; + // error tracking int m_errors; int m_warnings; @@ -128,8 +128,8 @@ private: int_map m_region_map; // callbacks - output_delegate m_saved_error_output; - output_delegate m_saved_warning_output; + output_delegate m_saved_error_output; + output_delegate m_saved_warning_output; }; #endif diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index 281dfea3aba..a79f669360a 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -20,15 +20,15 @@ - modernize - add emulated mc6845 hook-up - fix video update. - - rewrite video drawing functions (they are horrible) - - add VESA etc. - - "System Information" UI currently crashes the emulation + - rewrite video drawing functions (they are horrible) + - add VESA etc. + - "System Information" UI currently crashes the emulation - (and many more ...) - per-game issues: - - The Incredible Machine: fix partial updates - - MAME 0.01: fix 92 Hz refresh rate bug (uses VESA register?). - - Bio Menace: jerky H scrolling (uses EGA mode) + per-game issues: + - The Incredible Machine: fix partial updates + - MAME 0.01: fix 92 Hz refresh rate bug (uses VESA register?). + - Bio Menace: jerky H scrolling (uses EGA mode) - Virtual Pool: ET4k unrecognized; - California Chase (calchase): init bug causes messed up chars at POST (gfxs works if you soft reset). @@ -728,19 +728,19 @@ static void recompute_params(running_machine &machine) /* TODO: 10b and 11b settings aren't known */ pixel_clock = (vga.miscellaneous_output & 0xc) ? XTAL_28_63636MHz : XTAL_25_1748MHz; - pixel_clock /= (((vga.sequencer.data[1]&8) >> 3) + 1); + pixel_clock /= (((vga.sequencer.data[1]&8) >> 3) + 1); refresh = HZ_TO_ATTOSECONDS(pixel_clock) * (hblank_period) * vblank_period; machine.primary_screen->configure((hblank_period), (vblank_period), visarea, refresh ); -// popmessage("%d %d\n",vga.crtc.horz_total * 8,vga.crtc.vert_total); +// popmessage("%d %d\n",vga.crtc.horz_total * 8,vga.crtc.vert_total); } static void crtc_reg_write(running_machine &machine, UINT8 index, UINT8 data) { /* Doom does this */ -// if(vga.crtc.protect_enable && index <= 0x07) -// printf("write to protected address %02x\n",index); +// if(vga.crtc.protect_enable && index <= 0x07) +// printf("write to protected address %02x\n",index); switch(index) { @@ -878,7 +878,7 @@ static void seq_reg_write(running_machine &machine, UINT8 index, UINT8 data) break; case 0x03: /* --2- 84-- character select A - ---2 --84 character select B */ + ---2 --84 character select B */ vga.sequencer.char_sel.A = (((data & 0xc) >> 2)<<1) | ((data & 0x20) >> 5); vga.sequencer.char_sel.B = (((data & 0x3) >> 0)<<1) | ((data & 0x10) >> 4); if(data) @@ -1321,7 +1321,7 @@ READ8_HANDLER(vga_mem_r) WRITE8_HANDLER(vga_mem_w) { - //Inside each case must prevent writes to non-mapped VGA memory regions, not only mask the offset. + //Inside each case must prevent writes to non-mapped VGA memory regions, not only mask the offset. switch((vga.gc.data[6] >> 2) & 0x03) { case 0: break; diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index d5a36ad32d8..bb551aeb5dd 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -940,7 +940,7 @@ LEGACY_FLOPPY_OPTIONS_END /*************************************************************************** - New implementation + New implementation **************************************************************************** diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index 73a7fa8c5aa..3539d52cd89 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -226,34 +226,34 @@ class floppy_image_format_t public: floppy_image_format_t(); virtual ~floppy_image_format_t(); - + /*! @brief Identify an image. - The identify function tests if the image is valid - for this particular format. - @param io buffer containing the image data. - @param form_factor Physical form factor of disk, from the enum - in floppy_image - @return 1 if image valid, 0 otherwise. - */ + The identify function tests if the image is valid + for this particular format. + @param io buffer containing the image data. + @param form_factor Physical form factor of disk, from the enum + in floppy_image + @return 1 if image valid, 0 otherwise. + */ virtual int identify(io_generic *io, UINT32 form_factor) = 0; - + /*! @brief Load an image. - The load function opens an image file and converts it to the - internal MESS floppy representation. - @param io source buffer containing the image data. - @param form_factor Physical form factor of disk, from the enum - in floppy_image - @param image output buffer for data in MESS internal format. - @return true on success, false otherwise. - */ + The load function opens an image file and converts it to the + internal MESS floppy representation. + @param io source buffer containing the image data. + @param form_factor Physical form factor of disk, from the enum + in floppy_image + @param image output buffer for data in MESS internal format. + @return true on success, false otherwise. + */ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) = 0; - + /*! @brief Save an image. The save function writes back an image from the MESS internal floppy representation to the appropriate format on disk. @param io output buffer for the data in the on-disk format. @param image source buffer containing data in MESS internal format. - @return true on success, false otherwise. + @return true on success, false otherwise. */ virtual bool save(io_generic *io, floppy_image *image); @@ -275,7 +275,7 @@ public: //! @param file_name //! @returns true if file matches the extension. bool extension_matches(const char *file_name) const; - + protected: //! Input for convert_to_edge enum { @@ -289,16 +289,16 @@ protected: // **** Reader helpers **** //! Struct designed for easy track data description. Contains an opcode and two params. - + //! Optional, you can always do things by hand, but useful nevertheless. //! A vector of these structures describes one track. - + struct desc_e { int type, //!< An opcode - p1, //!< first param - p2; //!< second param + p1, //!< first param + p2; //!< second param }; - + //! Opcodes of the format description language used by generate_track() enum { END, //!< End of description @@ -347,40 +347,40 @@ protected: /*! @brief Generate one track according to the description vector. - @param desc track data description - @param track - @param head - @param sect a vector indexed by sector id. - @param sect_count number of sectors. - @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm. - @param image - */ + @param desc track data description + @param track + @param head + @param sect a vector indexed by sector id. + @param sect_count number of sectors. + @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm. + @param image + */ void generate_track(const desc_e *desc, int track, int head, const desc_s *sect, int sect_count, int track_size, floppy_image *image); /*! @brief Generate a track from cell binary values, MSB-first. - @param track - @param head - @param trackbuf track input buffer. - @param track_size in cells, not bytes. - @param image - */ + @param track + @param head + @param trackbuf track input buffer. + @param track_size in cells, not bytes. + @param image + */ void generate_track_from_bitstream(int track, int head, const UINT8 *trackbuf, int track_size, floppy_image *image); //! @brief Generate a track from cell level values (0/1/W/D/N). - + /*! Note that this function needs to be able to split cells in two, - so no time value should be less than 2, and even values are a - good idea. - */ + so no time value should be less than 2, and even values are a + good idea. + */ /*! @param track - @param head - @param trackbuf track input buffer. - @param track_size in cells, not bytes. - @param splice_pos is the position of the track splice. For normal - formats, use -1. For protected formats, you're supposed to - know. trackbuf may be modified at that position or after. - @param image - */ + @param head + @param trackbuf track input buffer. + @param track_size in cells, not bytes. + @param splice_pos is the position of the track splice. For normal + formats, use -1. For protected formats, you're supposed to + know. trackbuf may be modified at that position or after. + @param image + */ void generate_track_from_levels(int track, int head, UINT32 *trackbuf, int track_size, int splice_pos, floppy_image *image); //! Normalize the times in a cell buffer to sum up to 200000000 @@ -401,7 +401,7 @@ protected: // Fastcopy Pro optimized formats, with fake sector header for // faster verify and skew/interleave where appropriate - static const desc_e atari_st_fcp_9[]; + static const desc_e atari_st_fcp_9[]; static const desc_e *const atari_st_fcp_10[10]; static const desc_e atari_st_fcp_11[]; @@ -422,46 +422,46 @@ protected: // **** Writer helpers **** /*! @brief Rebuild a cell bitstream for a track. - Takes the cell standard - angular size as a parameter, gives out a msb-first bitstream. - - Beware that fuzzy bits will always give out the same value. - @param track - @param head - @param cell_size - @param trackbuf Output buffer size should be 34% more than the nominal number - of cells (the dpll tolerates a cell size down to 75% of the - nominal one, with gives a cell count of 1/0.75=1.333... times - the nominal one). - @param track_size Output size is given in bits (cells). - @param image - */ + Takes the cell standard + angular size as a parameter, gives out a msb-first bitstream. + + Beware that fuzzy bits will always give out the same value. + @param track + @param head + @param cell_size + @param trackbuf Output buffer size should be 34% more than the nominal number + of cells (the dpll tolerates a cell size down to 75% of the + nominal one, with gives a cell count of 1/0.75=1.333... times + the nominal one). + @param track_size Output size is given in bits (cells). + @param image + */ /*! @verbatim - Computing the standard angular size of a cell is - simple. Noting: - d = standard cell duration in microseconds - r = motor rotational speed in rpm - then: - a = r * d * 10 / 3. - Some values: - Type Cell RPM Size - - C1541 tr 1-17 3.25 300 3250 - C1541 tr 18-24 3.50 300 3500 - C1541 tr 25-30 3.75 300 3750 - C1541 tr 31+ 4.00 300 4000 - 5.25" SD 4 300 4000 - 5.25" DD 2 300 2000 - 5.25" HD 1 360 1200 - 3.5" SD 4 300 4000 - 3.5" DD 2 300 2000 - 3.5" HD 1 300 1000 - 3.5" ED 0.5 300 500 - @endverbatim - */ + Computing the standard angular size of a cell is + simple. Noting: + d = standard cell duration in microseconds + r = motor rotational speed in rpm + then: + a = r * d * 10 / 3. + Some values: + Type Cell RPM Size + + C1541 tr 1-17 3.25 300 3250 + C1541 tr 18-24 3.50 300 3500 + C1541 tr 25-30 3.75 300 3750 + C1541 tr 31+ 4.00 300 4000 + 5.25" SD 4 300 4000 + 5.25" DD 2 300 2000 + 5.25" HD 1 360 1200 + 3.5" SD 4 300 4000 + 3.5" DD 2 300 2000 + 3.5" HD 1 300 1000 + 3.5" ED 0.5 300 500 + @endverbatim + */ void generate_bitstream_from_track(int track, int head, int cell_size, UINT8 *trackbuf, int &track_size, floppy_image *image); - + //! Defines a standard sector for extracting. struct desc_xs { int track, //!< Track for this sector @@ -484,7 +484,7 @@ protected: //! @brief Get a geometry (including sectors) from an image. - + //! PC-type sectors with MFM encoding void get_geometry_mfm_pc(floppy_image *image, int cell_size, int &track_count, int &head_count, int §or_count); @@ -519,7 +519,7 @@ protected: private: enum { CRC_NONE, CRC_AMIGA, CRC_CCITT, CRC_MACHEAD }; enum { MAX_CRC_COUNT = 64 }; - + //! Holds data used internally for generating CRCs. struct gen_crc_info { int type, //!< Type of CRC @@ -598,7 +598,7 @@ public: TIME_MASK = 0x0fffffff, MG_MASK = 0xf0000000, MG_SHIFT = 28, //!< Bitshift constant for magnetic orientation data - MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A + MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A MG_B = (1 << MG_SHIFT), //!< - 1, MG_B -> Magnetic orientation B MG_N = (2 << MG_SHIFT), //!< - 2, MG_N -> Non-magnetized zone (neutral) MG_D = (3 << MG_SHIFT) //!< - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing @@ -626,30 +626,30 @@ public: //! floppy_image constructor /*! - @param _tracks number of tracks. - @param _heads number of heads. - @param _form_factor form factor of drive (from enum) - */ + @param _tracks number of tracks. + @param _heads number of heads. + @param _form_factor form factor of drive (from enum) + */ floppy_image(int tracks, int heads, UINT32 form_factor); virtual ~floppy_image(); - + //! @return the form factor. UINT32 get_form_factor() { return form_factor; } //! @return the variant. UINT32 get_variant() { return variant; } //! @param v the variant. - void set_variant(UINT32 v) { variant = v; } + void set_variant(UINT32 v) { variant = v; } /*! - @param track - @param head - @param size size of this track - */ + @param track + @param head + @param size size of this track + */ void set_track_size(int track, int head, UINT32 size) { track_size[track][head] = size; ensure_alloc(track, head); } - + /*! @param track track number - @param head head number + @param head head number @return a pointer to the data buffer for this track and head */ UINT32 *get_buffer(int track, int head) { return cell_data[track][head]; } @@ -657,7 +657,7 @@ public: //! @param track //! @param head UINT32 get_track_size(int track, int head) { return track_size[track][head]; } - + //! Sets the write splice position. //! The "track splice" information indicates where to start writing //! if you try to rewrite a physical disk with the data. Some @@ -666,9 +666,9 @@ public: //! representation is the angular position relative to the index. /*! @param track - @param head - @param pos the position - */ + @param head + @param pos the position + */ void set_write_splice_position(int track, int head, UINT32 pos) { write_splice[track][head] = pos; } //! @return the current write splice position. UINT32 get_write_splice_position(int track, int head) const { return write_splice[track][head]; } @@ -683,7 +683,7 @@ public: static const char *get_variant_name(UINT32 form_factor, UINT32 variant); private: - + enum { MAX_FLOPPY_HEADS = 2, MAX_FLOPPY_TRACKS = 84 diff --git a/src/lib/lib.mak b/src/lib/lib.mak index 9eb26d31713..f34ac98fc02 100644 --- a/src/lib/lib.mak +++ b/src/lib/lib.mak @@ -274,7 +274,7 @@ $(LIBOBJ)/libjpeg/%.o: $(LIBSRC)/libjpeg/%.c | $(OSPREBUILD) #------------------------------------------------- FLACOPTS=-DFLAC__NO_ASM -DHAVE_INTTYPES_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 - + LIBFLACOBJS = \ $(LIBOBJ)/libflac/bitmath.o \ $(LIBOBJ)/libflac/bitreader.o \ diff --git a/src/lib/libflac/include/flac++/decoder.h b/src/lib/libflac/include/flac++/decoder.h index b00a917a6e0..223602fa434 100644 --- a/src/lib/libflac/include/flac++/decoder.h +++ b/src/lib/libflac/include/flac++/decoder.h @@ -78,28 +78,28 @@ namespace FLAC { namespace Decoder { /** \ingroup flacpp_decoder - * \brief - * This class wraps the ::FLAC__StreamDecoder. If you are - * decoding from a file, FLAC::Decoder::File may be more - * convenient. - * - * The usage of this class is similar to FLAC__StreamDecoder, - * except instead of providing callbacks to - * FLAC__stream_decoder_init*_stream(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest - * of the calls work the same as in the C layer. - * - * Only the read, write, and error callbacks are mandatory. The - * others are optional; this class provides default - * implementations that do nothing. In order for seeking to work - * you must overide seek_callback(), tell_callback(), - * length_callback(), and eof_callback(). - */ + * \brief + * This class wraps the ::FLAC__StreamDecoder. If you are + * decoding from a file, FLAC::Decoder::File may be more + * convenient. + * + * The usage of this class is similar to FLAC__StreamDecoder, + * except instead of providing callbacks to + * FLAC__stream_decoder_init*_stream(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest + * of the calls work the same as in the C layer. + * + * Only the read, write, and error callbacks are mandatory. The + * others are optional; this class provides default + * implementations that do nothing. In order for seeking to work + * you must overide seek_callback(), tell_callback(), + * length_callback(), and eof_callback(). + */ class FLACPP_API Stream { public: /** This class is a wrapper around FLAC__StreamDecoderState. - */ + */ class FLACPP_API State { public: inline State(::FLAC__StreamDecoderState state): state_(state) { } @@ -115,8 +115,8 @@ namespace FLAC { //@{ /** Call after construction to check the that the object was created - * successfully. If not, use get_state() to find out why not. - */ + * successfully. If not, use get_state() to find out why not. + */ virtual bool is_valid() const; inline operator bool() const { return is_valid(); } ///< See is_valid() //@} @@ -201,24 +201,24 @@ namespace FLAC { }; /** \ingroup flacpp_decoder - * \brief - * This class wraps the ::FLAC__StreamDecoder. If you are - * not decoding from a file, you may need to use - * FLAC::Decoder::Stream. - * - * The usage of this class is similar to FLAC__StreamDecoder, - * except instead of providing callbacks to - * FLAC__stream_decoder_init*_FILE() or - * FLAC__stream_decoder_init*_file(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_off(). The rest - * of the calls work the same as in the C layer. - * - * Only the write, and error callbacks from FLAC::Decoder::Stream - * are mandatory. The others are optional; this class provides - * full working implementations for all other callbacks and - * supports seeking. - */ + * \brief + * This class wraps the ::FLAC__StreamDecoder. If you are + * not decoding from a file, you may need to use + * FLAC::Decoder::Stream. + * + * The usage of this class is similar to FLAC__StreamDecoder, + * except instead of providing callbacks to + * FLAC__stream_decoder_init*_FILE() or + * FLAC__stream_decoder_init*_file(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_off(). The rest + * of the calls work the same as in the C layer. + * + * Only the write, and error callbacks from FLAC::Decoder::Stream + * are mandatory. The others are optional; this class provides + * full working implementations for all other callbacks and + * supports seeking. + */ class FLACPP_API File: public Stream { public: File(); diff --git a/src/lib/libflac/include/flac++/encoder.h b/src/lib/libflac/include/flac++/encoder.h index d16d889d870..c89be19cfb6 100644 --- a/src/lib/libflac/include/flac++/encoder.h +++ b/src/lib/libflac/include/flac++/encoder.h @@ -79,29 +79,29 @@ namespace FLAC { namespace Encoder { /** \ingroup flacpp_encoder - * \brief - * This class wraps the ::FLAC__StreamEncoder. If you are - * encoding to a file, FLAC::Encoder::File may be more - * convenient. - * - * The usage of this class is similar to FLAC__StreamEncoder, - * except instead of providing callbacks to - * FLAC__stream_encoder_init*_stream(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest of - * the calls work the same as in the C layer. - * - * Only the write callback is mandatory. The others are - * optional; this class provides default implementations that do - * nothing. In order for some STREAMINFO and SEEKTABLE data to - * be written properly, you must overide seek_callback() and - * tell_callback(); see FLAC__stream_encoder_init_stream() as to - * why. - */ + * \brief + * This class wraps the ::FLAC__StreamEncoder. If you are + * encoding to a file, FLAC::Encoder::File may be more + * convenient. + * + * The usage of this class is similar to FLAC__StreamEncoder, + * except instead of providing callbacks to + * FLAC__stream_encoder_init*_stream(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest of + * the calls work the same as in the C layer. + * + * Only the write callback is mandatory. The others are + * optional; this class provides default implementations that do + * nothing. In order for some STREAMINFO and SEEKTABLE data to + * be written properly, you must overide seek_callback() and + * tell_callback(); see FLAC__stream_encoder_init_stream() as to + * why. + */ class FLACPP_API Stream { public: /** This class is a wrapper around FLAC__StreamEncoderState. - */ + */ class FLACPP_API State { public: inline State(::FLAC__StreamEncoderState state): state_(state) { } @@ -117,9 +117,9 @@ namespace FLAC { //@{ /** Call after construction to check the that the object was created - * successfully. If not, use get_state() to find out why not. - * - */ + * successfully. If not, use get_state() to find out why not. + * + */ virtual bool is_valid() const; inline operator bool() const { return is_valid(); } ///< See is_valid() //@} @@ -210,25 +210,25 @@ namespace FLAC { }; /** \ingroup flacpp_encoder - * \brief - * This class wraps the ::FLAC__StreamEncoder. If you are - * not encoding to a file, you may need to use - * FLAC::Encoder::Stream. - * - * The usage of this class is similar to FLAC__StreamEncoder, - * except instead of providing callbacks to - * FLAC__stream_encoder_init*_FILE() or - * FLAC__stream_encoder_init*_file(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest - * of the calls work the same as in the C layer. - * - * There are no mandatory callbacks; all the callbacks from - * FLAC::Encoder::Stream are implemented here fully and support - * full post-encode STREAMINFO and SEEKTABLE updating. There is - * only an optional progress callback which you may override to - * get periodic reports on the progress of the encode. - */ + * \brief + * This class wraps the ::FLAC__StreamEncoder. If you are + * not encoding to a file, you may need to use + * FLAC::Encoder::Stream. + * + * The usage of this class is similar to FLAC__StreamEncoder, + * except instead of providing callbacks to + * FLAC__stream_encoder_init*_FILE() or + * FLAC__stream_encoder_init*_file(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest + * of the calls work the same as in the C layer. + * + * There are no mandatory callbacks; all the callbacks from + * FLAC::Encoder::Stream are implemented here fully and support + * full post-encode STREAMINFO and SEEKTABLE updating. There is + * only an optional progress callback which you may override to + * get periodic reports on the progress of the encode. + */ class FLACPP_API File: public Stream { public: File(); diff --git a/src/lib/libflac/include/flac++/metadata.h b/src/lib/libflac/include/flac++/metadata.h index ba3bd385512..6e04f550d4e 100644 --- a/src/lib/libflac/include/flac++/metadata.h +++ b/src/lib/libflac/include/flac++/metadata.h @@ -81,51 +81,51 @@ namespace FLAC { // ============================================================ /** \defgroup flacpp_metadata_object FLAC++/metadata.h: metadata object classes - * \ingroup flacpp_metadata - * - * This module contains classes representing FLAC metadata - * blocks in memory. - * - * The behavior closely mimics the C layer interface; be - * sure to read the detailed description of the - * \link flac_metadata_object C metadata object module \endlink. - * - * Any time a metadata object is constructed or assigned, you - * should check is_valid() to make sure the underlying - * ::FLAC__StreamMetadata object was able to be created. - * - * \warning - * When the get_*() methods of any metadata object method - * return you a const pointer, DO NOT disobey and write into it. - * Always use the set_*() methods. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * This module contains classes representing FLAC metadata + * blocks in memory. + * + * The behavior closely mimics the C layer interface; be + * sure to read the detailed description of the + * \link flac_metadata_object C metadata object module \endlink. + * + * Any time a metadata object is constructed or assigned, you + * should check is_valid() to make sure the underlying + * ::FLAC__StreamMetadata object was able to be created. + * + * \warning + * When the get_*() methods of any metadata object method + * return you a const pointer, DO NOT disobey and write into it. + * Always use the set_*() methods. + * + * \{ + */ /** Base class for all metadata block types. - * See the \link flacpp_metadata_object overview \endlink for more. - */ + * See the \link flacpp_metadata_object overview \endlink for more. + */ class FLACPP_API Prototype { protected: //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ Prototype(const Prototype &); Prototype(const ::FLAC__StreamMetadata &); Prototype(const ::FLAC__StreamMetadata *); //@} /** Constructs an object with copy control. When \a copy - * is \c true, behaves identically to - * FLAC::Metadata::Prototype::Prototype(const ::FLAC__StreamMetadata *object). - * When \a copy is \c false, the instance takes ownership of - * the pointer and the ::FLAC__StreamMetadata object will - * be freed by the destructor. - * - * \assert - * \code object != NULL \endcode - */ + * is \c true, behaves identically to + * FLAC::Metadata::Prototype::Prototype(const ::FLAC__StreamMetadata *object). + * When \a copy is \c false, the instance takes ownership of + * the pointer and the ::FLAC__StreamMetadata object will + * be freed by the destructor. + * + * \assert + * \code object != NULL \endcode + */ Prototype(::FLAC__StreamMetadata *object, bool copy); //@{ @@ -136,23 +136,23 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ Prototype &assign_object(::FLAC__StreamMetadata *object, bool copy); /** Deletes the underlying ::FLAC__StreamMetadata object. - */ + */ virtual void clear(); ::FLAC__StreamMetadata *object_; public: /** Deletes the underlying ::FLAC__StreamMetadata object. - */ + */ virtual ~Prototype(); //@{ /** Check for equality, performing a deep compare by following pointers. - */ + */ inline bool operator==(const Prototype &) const; inline bool operator==(const ::FLAC__StreamMetadata &) const; inline bool operator==(const ::FLAC__StreamMetadata *) const; @@ -169,52 +169,52 @@ namespace FLAC { friend class Iterator; /** Returns \c true if the object was correctly constructed - * (i.e. the underlying ::FLAC__StreamMetadata object was - * properly allocated), else \c false. - */ + * (i.e. the underlying ::FLAC__StreamMetadata object was + * properly allocated), else \c false. + */ inline bool is_valid() const; /** Returns \c true if this block is the last block in a - * stream, else \c false. - * - * \assert - * \code is_valid() \endcode - */ + * stream, else \c false. + * + * \assert + * \code is_valid() \endcode + */ bool get_is_last() const; /** Returns the type of the block. - * - * \assert - * \code is_valid() \endcode - */ + * + * \assert + * \code is_valid() \endcode + */ ::FLAC__MetadataType get_type() const; /** Returns the stream length of the metadata block. - * - * \note - * The length does not include the metadata block header, - * per spec. - * - * \assert - * \code is_valid() \endcode - */ + * + * \note + * The length does not include the metadata block header, + * per spec. + * + * \assert + * \code is_valid() \endcode + */ unsigned get_length() const; /** Sets the "is_last" flag for the block. When using the iterators - * it is not necessary to set this flag; they will do it for you. - * - * \assert - * \code is_valid() \endcode - */ + * it is not necessary to set this flag; they will do it for you. + * + * \assert + * \code is_valid() \endcode + */ void set_is_last(bool); /** Returns a pointer to the underlying ::FLAC__StreamMetadata - * object. This can be useful for plugging any holes between - * the C++ and C interfaces. - * - * \assert - * \code is_valid() \endcode - */ + * object. This can be useful for plugging any holes between + * the C++ and C interfaces. + * + * \assert + * \code is_valid() \endcode + */ inline operator const ::FLAC__StreamMetadata *() const; private: /** Private and undefined so you can't use it. */ @@ -264,25 +264,25 @@ namespace FLAC { /** STREAMINFO metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. + */ class FLACPP_API StreamInfo : public Prototype { public: StreamInfo(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline StreamInfo(const StreamInfo &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline StreamInfo(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~StreamInfo(); @@ -295,8 +295,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline StreamInfo &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -338,25 +338,25 @@ namespace FLAC { }; /** PADDING metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_padding">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_padding">format specification</A>. + */ class FLACPP_API Padding : public Prototype { public: Padding(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Padding(const Padding &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Padding(); @@ -369,8 +369,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Padding &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -391,25 +391,25 @@ namespace FLAC { }; /** APPLICATION metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_application">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_application">format specification</A>. + */ class FLACPP_API Application : public Prototype { public: Application(); // //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Application(const Application &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Application(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Application(); @@ -422,8 +422,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Application &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -450,25 +450,25 @@ namespace FLAC { }; /** SEEKTABLE metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_seektable">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_seektable">format specification</A>. + */ class FLACPP_API SeekTable : public Prototype { public: SeekTable(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline SeekTable(const SeekTable &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline SeekTable(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~SeekTable(); @@ -481,8 +481,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline SeekTable &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -516,40 +516,40 @@ namespace FLAC { }; /** VORBIS_COMMENT metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>. + */ class FLACPP_API VorbisComment : public Prototype { public: /** Convenience class for encapsulating Vorbis comment - * entries. An entry is a vendor string or a comment - * field. In the case of a vendor string, the field - * name is undefined; only the field value is relevant. - * - * A \a field as used in the methods refers to an - * entire 'NAME=VALUE' string; for convenience the - * string is NUL-terminated. A length field is - * required in the unlikely event that the value - * contains contain embedded NULs. - * - * A \a field_name is what is on the left side of the - * first '=' in the \a field. By definition it is ASCII - * and so is NUL-terminated and does not require a - * length to describe it. \a field_name is undefined - * for a vendor string entry. - * - * A \a field_value is what is on the right side of the - * first '=' in the \a field. By definition, this may - * contain embedded NULs and so a \a field_value_length - * is required to describe it. However in practice, - * embedded NULs are not known to be used, so it is - * generally safe to treat field values as NUL- - * terminated UTF-8 strings. - * - * Always check is_valid() after the constructor or operator= - * to make sure memory was properly allocated and that the - * Entry conforms to the Vorbis comment specification. - */ + * entries. An entry is a vendor string or a comment + * field. In the case of a vendor string, the field + * name is undefined; only the field value is relevant. + * + * A \a field as used in the methods refers to an + * entire 'NAME=VALUE' string; for convenience the + * string is NUL-terminated. A length field is + * required in the unlikely event that the value + * contains contain embedded NULs. + * + * A \a field_name is what is on the left side of the + * first '=' in the \a field. By definition it is ASCII + * and so is NUL-terminated and does not require a + * length to describe it. \a field_name is undefined + * for a vendor string entry. + * + * A \a field_value is what is on the right side of the + * first '=' in the \a field. By definition, this may + * contain embedded NULs and so a \a field_value_length + * is required to describe it. However in practice, + * embedded NULs are not known to be used, so it is + * generally safe to treat field values as NUL- + * terminated UTF-8 strings. + * + * Always check is_valid() after the constructor or operator= + * to make sure memory was properly allocated and that the + * Entry conforms to the Vorbis comment specification. + */ class FLACPP_API Entry { public: Entry(); @@ -607,16 +607,16 @@ namespace FLAC { //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline VorbisComment(const VorbisComment &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline VorbisComment(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~VorbisComment(); @@ -629,8 +629,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline VorbisComment &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -668,17 +668,17 @@ namespace FLAC { }; /** CUESHEET metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_cuesheet">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_cuesheet">format specification</A>. + */ class FLACPP_API CueSheet : public Prototype { public: /** Convenience class for encapsulating a cue sheet - * track. - * - * Always check is_valid() after the constructor or operator= - * to make sure memory was properly allocated. - */ + * track. + * + * Always check is_valid() after the constructor or operator= + * to make sure memory was properly allocated. + */ class FLACPP_API Track { protected: ::FLAC__StreamMetadata_CueSheet_Track *object_; @@ -710,7 +710,7 @@ namespace FLAC { void set_type(unsigned value); inline void set_pre_emphasis(bool value) { object_->pre_emphasis = value? 1 : 0; } - void set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index); + void set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index); //@@@ It's awkward but to insert/delete index points //@@@ you must use the routines in the CueSheet class. }; @@ -719,16 +719,16 @@ namespace FLAC { //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline CueSheet(const CueSheet &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline CueSheet(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~CueSheet(); @@ -741,8 +741,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline CueSheet &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -795,25 +795,25 @@ namespace FLAC { }; /** PICTURE metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_picture">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_picture">format specification</A>. + */ class FLACPP_API Picture : public Prototype { public: Picture(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Picture(const Picture &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Picture(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Picture(); @@ -826,8 +826,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Picture &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -872,27 +872,27 @@ namespace FLAC { }; /** Opaque metadata block for storing unknown types. - * This should not be used unless you know what you are doing; - * it is currently used only internally to support forward - * compatibility of metadata blocks. - * See the \link flacpp_metadata_object overview \endlink for more, - */ + * This should not be used unless you know what you are doing; + * it is currently used only internally to support forward + * compatibility of metadata blocks. + * See the \link flacpp_metadata_object overview \endlink for more, + */ class FLACPP_API Unknown : public Prototype { public: Unknown(); // //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Unknown(const Unknown &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Unknown(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Unknown(); @@ -905,8 +905,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Unknown &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -934,16 +934,16 @@ namespace FLAC { /** \defgroup flacpp_metadata_level0 FLAC++/metadata.h: metadata level 0 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 0 metadata iterators. - * - * See the \link flac_metadata_level0 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 0 metadata iterators. + * + * See the \link flac_metadata_level0 C layer equivalent \endlink + * for more. + * + * \{ + */ FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo); ///< See FLAC__metadata_get_streaminfo(). @@ -960,43 +960,43 @@ namespace FLAC { /** \defgroup flacpp_metadata_level1 FLAC++/metadata.h: metadata level 1 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 1 metadata iterator. - * - * The flow through the iterator in the C++ layer is similar - * to the C layer: - * - Create a SimpleIterator instance - * - Check SimpleIterator::is_valid() - * - Call SimpleIterator::init() and check the return - * - Traverse and/or edit. Edits are written to file - * immediately. - * - Destroy the SimpleIterator instance - * - * The ownership of pointers in the C++ layer follows that in - * the C layer, i.e. - * - The objects returned by get_block() are yours to - * modify, but changes are not reflected in the FLAC file - * until you call set_block(). The objects are also - * yours to delete; they are not automatically deleted - * when passed to set_block() or insert_block_after(). - * - * See the \link flac_metadata_level1 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 1 metadata iterator. + * + * The flow through the iterator in the C++ layer is similar + * to the C layer: + * - Create a SimpleIterator instance + * - Check SimpleIterator::is_valid() + * - Call SimpleIterator::init() and check the return + * - Traverse and/or edit. Edits are written to file + * immediately. + * - Destroy the SimpleIterator instance + * + * The ownership of pointers in the C++ layer follows that in + * the C layer, i.e. + * - The objects returned by get_block() are yours to + * modify, but changes are not reflected in the FLAC file + * until you call set_block(). The objects are also + * yours to delete; they are not automatically deleted + * when passed to set_block() or insert_block_after(). + * + * See the \link flac_metadata_level1 C layer equivalent \endlink + * for more. + * + * \{ + */ /** This class is a wrapper around the FLAC__metadata_simple_iterator - * structures and methods; see the - * \link flacpp_metadata_level1 usage guide \endlink and - * ::FLAC__Metadata_SimpleIterator. - */ + * structures and methods; see the + * \link flacpp_metadata_level1 usage guide \endlink and + * ::FLAC__Metadata_SimpleIterator. + */ class FLACPP_API SimpleIterator { public: /** This class is a wrapper around FLAC__Metadata_SimpleIteratorStatus. - */ + */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_SimpleIteratorStatus status): status_(status) { } @@ -1038,51 +1038,51 @@ namespace FLAC { /** \defgroup flacpp_metadata_level2 FLAC++/metadata.h: metadata level 2 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 2 metadata iterator. - * - * The flow through the iterator in the C++ layer is similar - * to the C layer: - * - Create a Chain instance - * - Check Chain::is_valid() - * - Call Chain::read() and check the return - * - Traverse and/or edit with an Iterator or with - * Chain::merge_padding() or Chain::sort_padding() - * - Write changes back to FLAC file with Chain::write() - * - Destroy the Chain instance - * - * The ownership of pointers in the C++ layer is slightly - * different than in the C layer, i.e. - * - The objects returned by Iterator::get_block() are NOT - * owned by the iterator and should be deleted by the - * caller when finished, BUT, when you modify the block, - * it will directly edit what's in the chain and you do - * not need to call Iterator::set_block(). However the - * changes will not be reflected in the FLAC file until - * the chain is written with Chain::write(). - * - When you pass an object to Iterator::set_block(), - * Iterator::insert_block_before(), or - * Iterator::insert_block_after(), the iterator takes - * ownership of the block and it will be deleted by the - * chain. - * - * See the \link flac_metadata_level2 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 2 metadata iterator. + * + * The flow through the iterator in the C++ layer is similar + * to the C layer: + * - Create a Chain instance + * - Check Chain::is_valid() + * - Call Chain::read() and check the return + * - Traverse and/or edit with an Iterator or with + * Chain::merge_padding() or Chain::sort_padding() + * - Write changes back to FLAC file with Chain::write() + * - Destroy the Chain instance + * + * The ownership of pointers in the C++ layer is slightly + * different than in the C layer, i.e. + * - The objects returned by Iterator::get_block() are NOT + * owned by the iterator and should be deleted by the + * caller when finished, BUT, when you modify the block, + * it will directly edit what's in the chain and you do + * not need to call Iterator::set_block(). However the + * changes will not be reflected in the FLAC file until + * the chain is written with Chain::write(). + * - When you pass an object to Iterator::set_block(), + * Iterator::insert_block_before(), or + * Iterator::insert_block_after(), the iterator takes + * ownership of the block and it will be deleted by the + * chain. + * + * See the \link flac_metadata_level2 C layer equivalent \endlink + * for more. + * + * \{ + */ /** This class is a wrapper around the FLAC__metadata_chain - * structures and methods; see the - * \link flacpp_metadata_level2 usage guide \endlink and - * ::FLAC__Metadata_Chain. - */ + * structures and methods; see the + * \link flacpp_metadata_level2 usage guide \endlink and + * ::FLAC__Metadata_Chain. + */ class FLACPP_API Chain { public: /** This class is a wrapper around FLAC__Metadata_ChainStatus. - */ + */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_ChainStatus status): status_(status) { } @@ -1119,10 +1119,10 @@ namespace FLAC { }; /** This class is a wrapper around the FLAC__metadata_iterator - * structures and methods; see the - * \link flacpp_metadata_level2 usage guide \endlink and - * ::FLAC__Metadata_Iterator. - */ + * structures and methods; see the + * \link flacpp_metadata_level2 usage guide \endlink and + * ::FLAC__Metadata_Iterator. + */ class FLACPP_API Iterator { public: Iterator(); diff --git a/src/lib/libflac/include/flac/format.h b/src/lib/libflac/include/flac/format.h index 77e2d0130e5..a48e95c5e4d 100644 --- a/src/lib/libflac/include/flac/format.h +++ b/src/lib/libflac/include/flac/format.h @@ -84,8 +84,8 @@ extern "C" { /* - Most of the values described in this file are defined by the FLAC - format specification. There is nothing to tune here. + Most of the values described in this file are defined by the FLAC + format specification. There is nothing to tune here. */ /** The largest legal metadata type code. */ @@ -193,11 +193,11 @@ extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ typedef enum { FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, /**< Residual is coded by partitioning into contexts, each with it's own - * 4-bit Rice parameter. */ + * 4-bit Rice parameter. */ FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 /**< Residual is coded by partitioning into contexts, each with it's own - * 5-bit Rice parameter. */ + * 5-bit Rice parameter. */ } FLAC__EntropyCodingMethodType; /** Maps a FLAC__EntropyCodingMethodType to a C string. @@ -217,14 +217,14 @@ typedef struct { unsigned *raw_bits; /**< Widths for escape-coded partitions. Will be non-zero for escaped - * partitions and zero for unescaped partitions. - */ + * partitions and zero for unescaped partitions. + */ unsigned capacity_by_order; /**< The capacity of the \a parameters and \a raw_bits arrays - * specified as an order, i.e. the number of array elements - * allocated is 2 ^ \a capacity_by_order. - */ + * specified as an order, i.e. the number of array elements + * allocated is 2 ^ \a capacity_by_order. + */ } FLAC__EntropyCodingMethod_PartitionedRiceContents; /** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>) @@ -425,21 +425,21 @@ typedef struct { FLAC__FrameNumberType number_type; /**< The numbering scheme used for the frame. As a convenience, the - * decoder will always convert a frame number to a sample number because - * the rules are complex. */ + * decoder will always convert a frame number to a sample number because + * the rules are complex. */ union { FLAC__uint32 frame_number; FLAC__uint64 sample_number; } number; /**< The frame number or sample number of first sample in frame; - * use the \a number_type value to determine which to use. */ + * use the \a number_type value to determine which to use. */ FLAC__uint8 crc; /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) - * of the raw frame header bytes, meaning everything before the CRC byte - * including the sync code. - */ + * of the raw frame header bytes, meaning everything before the CRC byte + * including the sync code. + */ } FLAC__FrameHeader; extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ @@ -459,9 +459,9 @@ extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ typedef struct { FLAC__uint16 crc; /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with - * 0) of the bytes before the crc, back to and including the frame header - * sync code. - */ + * 0) of the bytes before the crc, back to and including the frame header + * sync code. + */ } FLAC__FrameFooter; extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ @@ -551,9 +551,9 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< typedef struct { int dummy; /**< Conceptually this is an empty struct since we don't store the - * padding bytes. Empty structs are not allowed by some C compilers, - * hence the dummy. - */ + * padding bytes. Empty structs are not allowed by some C compilers, + * hence the dummy. + */ } FLAC__StreamMetadata_Padding; @@ -574,7 +574,7 @@ typedef struct { FLAC__uint64 stream_offset; /**< The offset, in bytes, of the target frame with respect to - * beginning of the first frame. */ + * beginning of the first frame. */ unsigned frame_samples; /**< The number of samples in the target frame. */ @@ -644,8 +644,8 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS typedef struct { FLAC__uint64 offset; /**< Offset in samples, relative to the track offset, of the index - * point. - */ + * point. + */ FLAC__byte number; /**< The index point number. */ @@ -700,9 +700,9 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_ typedef struct { char media_catalog_number[129]; /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In - * general, the media catalog number may be 0 to 128 bytes long; any - * unused characters should be right-padded with NUL characters. - */ + * general, the media catalog number may be 0 to 128 bytes long; any + * unused characters should be right-padded with NUL characters. + */ FLAC__uint64 lead_in; /**< The number of lead-in samples. */ @@ -769,21 +769,21 @@ typedef struct { char *mime_type; /**< Picture data's MIME type, in ASCII printable characters - * 0x20-0x7e, NUL terminated. For best compatibility with players, - * use picture data of MIME type \c image/jpeg or \c image/png. A - * MIME type of '-->' is also allowed, in which case the picture - * data should be a complete URL. In file storage, the MIME type is - * stored as a 32-bit length followed by the ASCII string with no NUL - * terminator, but is converted to a plain C string in this structure - * for convenience. - */ + * 0x20-0x7e, NUL terminated. For best compatibility with players, + * use picture data of MIME type \c image/jpeg or \c image/png. A + * MIME type of '-->' is also allowed, in which case the picture + * data should be a complete URL. In file storage, the MIME type is + * stored as a 32-bit length followed by the ASCII string with no NUL + * terminator, but is converted to a plain C string in this structure + * for convenience. + */ FLAC__byte *description; /**< Picture's description in UTF-8, NUL terminated. In file storage, - * the description is stored as a 32-bit length followed by the UTF-8 - * string with no NUL terminator, but is converted to a plain C string - * in this structure for convenience. - */ + * the description is stored as a 32-bit length followed by the UTF-8 + * string with no NUL terminator, but is converted to a plain C string + * in this structure for convenience. + */ FLAC__uint32 width; /**< Picture's width in pixels. */ @@ -796,8 +796,8 @@ typedef struct { FLAC__uint32 colors; /**< For indexed palettes (like GIF), picture's number of colors (the - * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). - */ + * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). + */ FLAC__uint32 data_length; /**< Length of binary picture data in bytes. */ @@ -831,8 +831,8 @@ typedef struct { typedef struct { FLAC__MetadataType type; /**< The type of the metadata block; used determine which member of the - * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED - * then \a data.unknown must be used. */ + * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED + * then \a data.unknown must be used. */ FLAC__bool is_last; /**< \c true if this metadata block is the last, else \a false */ @@ -851,7 +851,7 @@ typedef struct { FLAC__StreamMetadata_Unknown unknown; } data; /**< Polymorphic block data; use the \a type value to determine which - * to use. */ + * to use. */ } FLAC__StreamMetadata; extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ diff --git a/src/lib/libflac/include/flac/metadata.h b/src/lib/libflac/include/flac/metadata.h index fff90b0bafd..6453b748e99 100644 --- a/src/lib/libflac/include/flac/metadata.h +++ b/src/lib/libflac/include/flac/metadata.h @@ -762,22 +762,22 @@ typedef enum { FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, /**< FLAC__metadata_chain_write() was called on a chain read by - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), - * or - * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() - * was called on a chain read by - * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). - * Matching read/write methods must always be used. */ + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * or + * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() + * was called on a chain read by + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Matching read/write methods must always be used. */ FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL /**< FLAC__metadata_chain_write_with_callbacks() was called when the - * chain write requires a tempfile; use - * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. - * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was - * called when the chain write does not require a tempfile; use - * FLAC__metadata_chain_write_with_callbacks() instead. - * Always check FLAC__metadata_chain_check_if_tempfile_needed() - * before writing via callbacks. */ + * chain write requires a tempfile; use + * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. + * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was + * called when the chain write does not require a tempfile; use + * FLAC__metadata_chain_write_with_callbacks() instead. + * Always check FLAC__metadata_chain_check_if_tempfile_needed() + * before writing via callbacks. */ } FLAC__Metadata_ChainStatus; diff --git a/src/lib/libflac/include/flac/stream_decoder.h b/src/lib/libflac/include/flac/stream_decoder.h index 9ac159474af..8c2dc51bfb4 100644 --- a/src/lib/libflac/include/flac/stream_decoder.h +++ b/src/lib/libflac/include/flac/stream_decoder.h @@ -208,8 +208,8 @@ typedef enum { FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, /**< The decoder is ready to or is in the process of searching for the - * frame sync code. - */ + * frame sync code. + */ FLAC__STREAM_DECODER_READ_FRAME, /**< The decoder is ready to or is in the process of reading a frame. */ @@ -222,23 +222,23 @@ typedef enum { FLAC__STREAM_DECODER_SEEK_ERROR, /**< An error occurred while seeking. The decoder must be flushed - * with FLAC__stream_decoder_flush() or reset with - * FLAC__stream_decoder_reset() before decoding can continue. - */ + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + */ FLAC__STREAM_DECODER_ABORTED, /**< The decoder was aborted by the read callback. */ FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, /**< An error occurred allocating memory. The decoder is in an invalid - * state and can no longer be used. - */ + * state and can no longer be used. + */ FLAC__STREAM_DECODER_UNINITIALIZED /**< The decoder is in the uninitialized state; one of the - * FLAC__stream_decoder_init_*() functions must be called before samples - * can be processed. - */ + * FLAC__stream_decoder_init_*() functions must be called before samples + * can be processed. + */ } FLAC__StreamDecoderState; @@ -259,8 +259,8 @@ typedef enum { FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, /**< The library was not compiled with support for the given container - * format. - */ + * format. + */ FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, /**< A required callback was not supplied. */ @@ -270,13 +270,13 @@ typedef enum { FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, /**< fopen() failed in FLAC__stream_decoder_init_file() or - * FLAC__stream_decoder_init_ogg_file(). */ + * FLAC__stream_decoder_init_ogg_file(). */ FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED /**< FLAC__stream_decoder_init_*() was called when the decoder was - * already initialized, usually because - * FLAC__stream_decoder_finish() was not called. - */ + * already initialized, usually because + * FLAC__stream_decoder_finish() was not called. + */ } FLAC__StreamDecoderInitStatus; @@ -297,14 +297,14 @@ typedef enum { FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, /**< The read was attempted while at the end of the stream. Note that - * the client must only return this value when the read callback was - * called when already at the end of the stream. Otherwise, if the read - * itself moves to the end of the stream, the client should still return - * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on - * the next read callback it should return - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count - * of \c 0. - */ + * the client must only return this value when the read callback was + * called when already at the end of the stream. Otherwise, if the read + * itself moves to the end of the stream, the client should still return + * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on + * the next read callback it should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count + * of \c 0. + */ FLAC__STREAM_DECODER_READ_STATUS_ABORT /**< An unrecoverable error occurred. The decoder will return from the process call. */ diff --git a/src/lib/libflac/include/flac/stream_encoder.h b/src/lib/libflac/include/flac/stream_encoder.h index dbbbb23ee11..0f609a15ba0 100644 --- a/src/lib/libflac/include/flac/stream_encoder.h +++ b/src/lib/libflac/include/flac/stream_encoder.h @@ -244,35 +244,35 @@ typedef enum { FLAC__STREAM_ENCODER_UNINITIALIZED, /**< The encoder is in the uninitialized state; one of the - * FLAC__stream_encoder_init_*() functions must be called before samples - * can be processed. - */ + * FLAC__stream_encoder_init_*() functions must be called before samples + * can be processed. + */ FLAC__STREAM_ENCODER_OGG_ERROR, /**< An error occurred in the underlying Ogg layer. */ FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR, /**< An error occurred in the underlying verify stream decoder; - * check FLAC__stream_encoder_get_verify_decoder_state(). - */ + * check FLAC__stream_encoder_get_verify_decoder_state(). + */ FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA, /**< The verify decoder detected a mismatch between the original - * audio signal and the decoded audio signal. - */ + * audio signal and the decoded audio signal. + */ FLAC__STREAM_ENCODER_CLIENT_ERROR, /**< One of the callbacks returned a fatal error. */ FLAC__STREAM_ENCODER_IO_ERROR, /**< An I/O error occurred while opening/reading/writing a file. - * Check \c errno. - */ + * Check \c errno. + */ FLAC__STREAM_ENCODER_FRAMING_ERROR, /**< An error occurred while writing the stream; usually, the - * write_callback returned an error. - */ + * write_callback returned an error. + */ FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR /**< Memory allocation failed. */ @@ -299,8 +299,8 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER, /**< The library was not compiled with support for the given container - * format. - */ + * format. + */ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS, /**< A required callback was not supplied. */ @@ -310,9 +310,9 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE, /**< The encoder has an invalid setting for bits-per-sample. - * FLAC supports 4-32 bps but the reference encoder currently supports - * only up to 24 bps. - */ + * FLAC supports 4-32 bps but the reference encoder currently supports + * only up to 24 bps. + */ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE, /**< The encoder has an invalid setting for the input sample rate. */ @@ -334,18 +334,18 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, /**< The metadata input to the encoder is invalid, in one of the following ways: - * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 - * - One of the metadata blocks contains an undefined type - * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() - * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() - * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block - */ + * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 + * - One of the metadata blocks contains an undefined type + * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() + * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() + * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block + */ FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED /**< FLAC__stream_encoder_init_*() was called when the encoder was - * already initialized, usually because - * FLAC__stream_encoder_finish() was not called. - */ + * already initialized, usually because + * FLAC__stream_encoder_finish() was not called. + */ } FLAC__StreamEncoderInitStatus; diff --git a/src/lib/libflac/include/private/fixed.h b/src/lib/libflac/include/private/fixed.h index 85abf1d5374..34f8b728317 100644 --- a/src/lib/libflac/include/private/fixed.h +++ b/src/lib/libflac/include/private/fixed.h @@ -40,16 +40,16 @@ #include "flac/format.h" /* - * FLAC__fixed_compute_best_predictor() - * -------------------------------------------------------------------- - * Compute the best fixed predictor and the expected bits-per-sample + * FLAC__fixed_compute_best_predictor() + * -------------------------------------------------------------------- + * Compute the best fixed predictor and the expected bits-per-sample * of the residual signal for each order. The _wide() version uses * 64-bit integers which is statistically necessary when bits-per- * sample + log2(blocksize) > 30 * - * IN data[0,data_len-1] - * IN data_len - * OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER] + * IN data[0,data_len-1] + * IN data_len + * OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER] */ #ifndef FLAC__INTEGER_ONLY_LIBRARY unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); @@ -67,30 +67,30 @@ unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsig #endif /* - * FLAC__fixed_compute_residual() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. + * FLAC__fixed_compute_residual() + * -------------------------------------------------------------------- + * Compute the residual signal obtained from sutracting the predicted + * signal from the original. * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * OUT residual[0,data_len-1] residual signal + * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) + * IN data_len length of original signal + * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order + * OUT residual[0,data_len-1] residual signal */ void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]); /* - * FLAC__fixed_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. + * FLAC__fixed_restore_signal() + * -------------------------------------------------------------------- + * Restore the original signal by summing the residual and the + * predictor. * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal + * IN residual[0,data_len-1] residual signal + * IN data_len length of original signal + * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order + * *** IMPORTANT: the caller must pass in the historical samples: + * IN data[-order,-1] previously-reconstructed historical samples + * OUT data[0,data_len-1] original signal */ void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]); diff --git a/src/lib/libflac/include/private/float.h b/src/lib/libflac/include/private/float.h index 75b99503bf3..e6dca74caad 100644 --- a/src/lib/libflac/include/private/float.h +++ b/src/lib/libflac/include/private/float.h @@ -74,21 +74,21 @@ extern const FLAC__fixedpoint FLAC__FP_E; #define FLAC__fixedpoint_div(x, y) ( (FLAC__fixedpoint) ( ( ((FLAC__int64)(x)<<32) / (FLAC__int64)(y) ) >> 16 ) ) /* - * FLAC__fixedpoint_log2() - * -------------------------------------------------------------------- - * Returns the base-2 logarithm of the fixed-point number 'x' using an - * algorithm by Knuth for x >= 1.0 + * FLAC__fixedpoint_log2() + * -------------------------------------------------------------------- + * Returns the base-2 logarithm of the fixed-point number 'x' using an + * algorithm by Knuth for x >= 1.0 * - * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must - * be < 32 and evenly divisible by 4 (0 is OK but not very precise). + * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must + * be < 32 and evenly divisible by 4 (0 is OK but not very precise). * - * 'precision' roughly limits the number of iterations that are done; - * use (unsigned)(-1) for maximum precision. + * 'precision' roughly limits the number of iterations that are done; + * use (unsigned)(-1) for maximum precision. * - * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this - * function will punt and return 0. + * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this + * function will punt and return 0. * - * The return value will also have 'fracbits' fractional bits. + * The return value will also have 'fracbits' fractional bits. */ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision); diff --git a/src/lib/libflac/include/private/lpc.h b/src/lib/libflac/include/private/lpc.h index 5eb91f7d988..eda5c491935 100644 --- a/src/lib/libflac/include/private/lpc.h +++ b/src/lib/libflac/include/private/lpc.h @@ -42,29 +42,29 @@ #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__lpc_window_data() - * -------------------------------------------------------------------- - * Applies the given window to the data. + * FLAC__lpc_window_data() + * -------------------------------------------------------------------- + * Applies the given window to the data. * OPT: asm implementation * - * IN in[0,data_len-1] - * IN window[0,data_len-1] - * OUT out[0,lag-1] - * IN data_len + * IN in[0,data_len-1] + * IN window[0,data_len-1] + * OUT out[0,lag-1] + * IN data_len */ void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len); /* - * FLAC__lpc_compute_autocorrelation() - * -------------------------------------------------------------------- - * Compute the autocorrelation for lags between 0 and lag-1. - * Assumes data[] outside of [0,data_len-1] == 0. - * Asserts that lag > 0. + * FLAC__lpc_compute_autocorrelation() + * -------------------------------------------------------------------- + * Compute the autocorrelation for lags between 0 and lag-1. + * Assumes data[] outside of [0,data_len-1] == 0. + * Asserts that lag > 0. * - * IN data[0,data_len-1] - * IN data_len - * IN 0 < lag <= data_len - * OUT autoc[0,lag-1] + * IN data[0,data_len-1] + * IN data_len + * IN 0 < lag <= data_len + * OUT autoc[0,lag-1] */ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); #ifndef FLAC__NO_ASM @@ -80,44 +80,44 @@ void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], u #endif /* - * FLAC__lpc_compute_lp_coefficients() - * -------------------------------------------------------------------- - * Computes LP coefficients for orders 1..max_order. - * Do not call if autoc[0] == 0.0. This means the signal is zero - * and there is no point in calculating a predictor. + * FLAC__lpc_compute_lp_coefficients() + * -------------------------------------------------------------------- + * Computes LP coefficients for orders 1..max_order. + * Do not call if autoc[0] == 0.0. This means the signal is zero + * and there is no point in calculating a predictor. * - * IN autoc[0,max_order] autocorrelation values - * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute - * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order - * *** IMPORTANT: - * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched - * OUT error[0,max_order-1] error for each order (more - * specifically, the variance of - * the error signal times # of - * samples in the signal) + * IN autoc[0,max_order] autocorrelation values + * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute + * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order + * *** IMPORTANT: + * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched + * OUT error[0,max_order-1] error for each order (more + * specifically, the variance of + * the error signal times # of + * samples in the signal) * - * Example: if max_order is 9, the LP coefficients for order 9 will be - * in lp_coeff[8][0,8], the LP coefficients for order 8 will be - * in lp_coeff[7][0,7], etc. + * Example: if max_order is 9, the LP coefficients for order 9 will be + * in lp_coeff[8][0,8], the LP coefficients for order 8 will be + * in lp_coeff[7][0,7], etc. */ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]); /* - * FLAC__lpc_quantize_coefficients() - * -------------------------------------------------------------------- - * Quantizes the LP coefficients. NOTE: precision + bits_per_sample - * must be less than 32 (sizeof(FLAC__int32)*8). + * FLAC__lpc_quantize_coefficients() + * -------------------------------------------------------------------- + * Quantizes the LP coefficients. NOTE: precision + bits_per_sample + * must be less than 32 (sizeof(FLAC__int32)*8). * - * IN lp_coeff[0,order-1] LP coefficients - * IN order LP order - * IN FLAC__MIN_QLP_COEFF_PRECISION < precision - * desired precision (in bits, including sign - * bit) of largest coefficient - * OUT qlp_coeff[0,order-1] quantized coefficients - * OUT shift # of bits to shift right to get approximated - * LP coefficients. NOTE: could be negative. - * RETURN 0 => quantization OK - * 1 => coefficients require too much shifting for *shift to + * IN lp_coeff[0,order-1] LP coefficients + * IN order LP order + * IN FLAC__MIN_QLP_COEFF_PRECISION < precision + * desired precision (in bits, including sign + * bit) of largest coefficient + * OUT qlp_coeff[0,order-1] quantized coefficients + * OUT shift # of bits to shift right to get approximated + * LP coefficients. NOTE: could be negative. + * RETURN 0 => quantization OK + * 1 => coefficients require too much shifting for *shift to * fit in the LPC subframe header. 'shift' is unset. * 2 => coefficients are all zero, which is bad. 'shift' is * unset. @@ -125,17 +125,17 @@ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_o int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift); /* - * FLAC__lpc_compute_residual_from_qlp_coefficients() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. + * FLAC__lpc_compute_residual_from_qlp_coefficients() + * -------------------------------------------------------------------- + * Compute the residual signal obtained from sutracting the predicted + * signal from the original. * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * OUT residual[0,data_len-1] residual signal + * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) + * IN data_len length of original signal + * IN qlp_coeff[0,order-1] quantized LP coefficients + * IN order > 0 LP order + * IN lp_quantization quantization of LP coefficients in bits + * OUT residual[0,data_len-1] residual signal */ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); @@ -151,19 +151,19 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__i #endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ /* - * FLAC__lpc_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. + * FLAC__lpc_restore_signal() + * -------------------------------------------------------------------- + * Restore the original signal by summing the residual and the + * predictor. * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal + * IN residual[0,data_len-1] residual signal + * IN data_len length of original signal + * IN qlp_coeff[0,order-1] quantized LP coefficients + * IN order > 0 LP order + * IN lp_quantization quantization of LP coefficients in bits + * *** IMPORTANT: the caller must pass in the historical samples: + * IN data[-order,-1] previously-reconstructed historical samples + * OUT data[0,data_len-1] original signal */ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); @@ -182,30 +182,30 @@ void FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residu #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__lpc_compute_expected_bits_per_residual_sample() - * -------------------------------------------------------------------- - * Compute the expected number of bits per residual signal sample - * based on the LP error (which is related to the residual variance). + * FLAC__lpc_compute_expected_bits_per_residual_sample() + * -------------------------------------------------------------------- + * Compute the expected number of bits per residual signal sample + * based on the LP error (which is related to the residual variance). * - * IN lpc_error >= 0.0 error returned from calculating LP coefficients - * IN total_samples > 0 # of samples in residual signal - * RETURN expected bits per sample + * IN lpc_error >= 0.0 error returned from calculating LP coefficients + * IN total_samples > 0 # of samples in residual signal + * RETURN expected bits per sample */ FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lpc_error, unsigned total_samples); FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(FLAC__double lpc_error, FLAC__double error_scale); /* - * FLAC__lpc_compute_best_order() - * -------------------------------------------------------------------- - * Compute the best order from the array of signal errors returned - * during coefficient computation. + * FLAC__lpc_compute_best_order() + * -------------------------------------------------------------------- + * Compute the best order from the array of signal errors returned + * during coefficient computation. * - * IN lpc_error[0,max_order-1] >= 0.0 error returned from calculating LP coefficients - * IN max_order > 0 max LP order - * IN total_samples > 0 # of samples in residual signal - * IN overhead_bits_per_order # of bits overhead for each increased LP order - * (includes warmup sample size and quantized LP coefficient) - * RETURN [1,max_order] best order + * IN lpc_error[0,max_order-1] >= 0.0 error returned from calculating LP coefficients + * IN max_order > 0 max LP order + * IN total_samples > 0 # of samples in residual signal + * IN overhead_bits_per_order # of bits overhead for each increased LP order + * (includes warmup sample size and quantized LP coefficient) + * RETURN [1,max_order] best order */ unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order); diff --git a/src/lib/libflac/include/private/window.h b/src/lib/libflac/include/private/window.h index e063b4636df..dbb2a73f52a 100644 --- a/src/lib/libflac/include/private/window.h +++ b/src/lib/libflac/include/private/window.h @@ -42,13 +42,13 @@ #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__window_*() - * -------------------------------------------------------------------- - * Calculates window coefficients according to different apodization - * functions. + * FLAC__window_*() + * -------------------------------------------------------------------- + * Calculates window coefficients according to different apodization + * functions. * - * OUT window[0,L-1] - * IN L (number of points in window) + * OUT window[0,L-1] + * IN L (number of points in window) */ void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L); void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L); diff --git a/src/lib/libflac/libflac/bitreader.c b/src/lib/libflac/libflac/bitreader.c index 9ae61705bb0..02e4d4ba4b0 100644 --- a/src/lib/libflac/libflac/bitreader.c +++ b/src/lib/libflac/libflac/bitreader.c @@ -217,21 +217,21 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) } /* - * set the target for reading, taking into account word alignment and endianness - */ + * set the target for reading, taking into account word alignment and endianness + */ bytes = (br->capacity - br->words) * FLAC__BYTES_PER_WORD - br->bytes; if(bytes == 0) return false; /* no space left, buffer is too small; see note for FLAC__BITREADER_DEFAULT_CAPACITY */ target = ((FLAC__byte*)(br->buffer+br->words)) + br->bytes; /* before reading, if the existing reader looks like this (say brword is 32 bits wide) - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 (partial tail word is left-justified) - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? (shown layed out as bytes sequentially in memory) - * buffer[LE]: 44 33 22 11 ?? ?? ?? 55 (?? being don't-care) - * ^^-------target, bytes=3 - * on LE machines, have to byteswap the odd tail word so nothing is - * overwritten: - */ + * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 (partial tail word is left-justified) + * buffer[BE]: 11 22 33 44 55 ?? ?? ?? (shown layed out as bytes sequentially in memory) + * buffer[LE]: 44 33 22 11 ?? ?? ?? 55 (?? being don't-care) + * ^^-------target, bytes=3 + * on LE machines, have to byteswap the odd tail word so nothing is + * overwritten: + */ #if WORDS_BIGENDIAN #else if(br->bytes) @@ -239,22 +239,22 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) #endif /* now it looks like: - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? - * buffer[LE]: 44 33 22 11 55 ?? ?? ?? - * ^^-------target, bytes=3 - */ + * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 + * buffer[BE]: 11 22 33 44 55 ?? ?? ?? + * buffer[LE]: 44 33 22 11 55 ?? ?? ?? + * ^^-------target, bytes=3 + */ /* read in the data; note that the callback may return a smaller number of bytes */ if(!br->read_callback(target, &bytes, br->client_data)) return false; /* after reading bytes 66 77 88 99 AA BB CC DD EE FF from the client: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 55 66 77 88 99 AA BB CC DD EE FF ?? - * now have to byteswap on LE machines: - */ + * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF + * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? + * buffer[LE]: 44 33 22 11 55 66 77 88 99 AA BB CC DD EE FF ?? + * now have to byteswap on LE machines: + */ #if WORDS_BIGENDIAN #else end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD; @@ -270,11 +270,11 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) #endif /* now it looks like: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 88 77 66 55 CC BB AA 99 ?? FF EE DD - * finally we'll update the reader values: - */ + * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF + * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? + * buffer[LE]: 44 33 22 11 88 77 66 55 CC BB AA 99 ?? FF EE DD + * finally we'll update the reader values: + */ end = br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes; br->words = end / FLAC__BYTES_PER_WORD; br->bytes = end % FLAC__BYTES_PER_WORD; @@ -293,14 +293,14 @@ FLAC__BitReader *FLAC__bitreader_new(void) FLAC__BitReader *br = (FLAC__BitReader*)calloc(1, sizeof(FLAC__BitReader)); /* calloc() implies: - memset(br, 0, sizeof(FLAC__BitReader)); - br->buffer = 0; - br->capacity = 0; - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - br->read_callback = 0; - br->client_data = 0; - */ + memset(br, 0, sizeof(FLAC__BitReader)); + br->buffer = 0; + br->capacity = 0; + br->words = br->bytes = 0; + br->consumed_words = br->consumed_bits = 0; + br->read_callback = 0; + br->client_data = 0; + */ return br; } @@ -487,9 +487,9 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLA } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'bits' bits + * available to read, which makes this case simpler. + */ /* OPT: taking out the consumed_bits==0 "else" case below might make things faster if less code allows the compiler to inline this function */ if(br->consumed_bits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ @@ -566,9 +566,9 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReade FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, unsigned bits) { /* - * OPT: a faster implementation is possible but probably not that useful - * since this is only called a couple of times in the metadata readers. - */ + * OPT: a faster implementation is possible but probably not that useful + * since this is only called a couple of times in the metadata readers. + */ FLAC__ASSERT(0 != br); FLAC__ASSERT(0 != br->buffer); @@ -740,12 +740,12 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[br->consumed_words] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << br->consumed_bits; @@ -808,8 +808,8 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ + * must remember to flush them back to *br before calling other + * bitwriter functions that use them, and before returning */ register unsigned cwords; register unsigned cbits; @@ -863,12 +863,12 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; @@ -889,9 +889,9 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ } } /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -905,9 +905,9 @@ break1: if(bits) { while((br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits < bits) { /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -948,9 +948,9 @@ break1: } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'bits' bits + * available to read, which makes this case simpler. + */ uval <<= bits; if(cbits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ @@ -989,8 +989,8 @@ break2: unsigned uval = 0; /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ + * must remember to flush them back to *br before calling other + * bitwriter functions that use them, and before returning */ register unsigned cwords; register unsigned cbits; unsigned ucbits; /* keep track of the number of unconsumed bits in the buffer */ @@ -1046,12 +1046,12 @@ break2: } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)) << cbits; @@ -1071,9 +1071,9 @@ break2: } } /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -1081,9 +1081,9 @@ break2: cwords = br->consumed_words; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits + uval; /* + uval to offset our count by the # of unary bits already - * consumed before the read, because we will add these back - * in all at once at break1 - */ + * consumed before the read, because we will add these back + * in all at once at break1 + */ } break1: ucbits -= uval; @@ -1095,9 +1095,9 @@ break1: if(parameter) { while(ucbits < parameter) { /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -1135,9 +1135,9 @@ break1: } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'parameter' - * bits available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'parameter' + * bits available to read, which makes this case simpler. + */ uval <<= parameter; if(cbits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ diff --git a/src/lib/libflac/libflac/bitwriter.c b/src/lib/libflac/libflac/bitwriter.c index 7f2589ab002..250295d2528 100644 --- a/src/lib/libflac/libflac/bitwriter.c +++ b/src/lib/libflac/libflac/bitwriter.c @@ -123,8 +123,8 @@ static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add) new_capacity = bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD); /* it's possible (due to pessimism in the growth estimation that - * leads to this call) that we don't actually need to grow - */ + * leads to this call) that we don't actually need to grow + */ if(bw->capacity >= new_capacity) return true; @@ -288,8 +288,8 @@ FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **bu void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw) { /* nothing to do. in the future, strict checking of a 'writer-is-in- - * get-mode' flag could be added everywhere and then cleared here - */ + * get-mode' flag could be added everywhere and then cleared here + */ (void)bw; } @@ -629,9 +629,9 @@ break1: } else { /* if bw->bits == 0, left==FLAC__BITS_PER_WORD which will always - * be > lsbits (because of previous assertions) so it would have - * triggered the (lsbits<left) case above. - */ + * be > lsbits (because of previous assertions) so it would have + * triggered the (lsbits<left) case above. + */ FLAC__ASSERT(bw->bits); FLAC__ASSERT(left < FLAC__BITS_PER_WORD); bw->accum <<= left; diff --git a/src/lib/libflac/libflac/cpu.c b/src/lib/libflac/libflac/cpu.c index 60b73bff143..73b51f58eae 100644 --- a/src/lib/libflac/libflac/cpu.c +++ b/src/lib/libflac/libflac/cpu.c @@ -211,8 +211,8 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) #endif /* - * now have to check for OS support of SSE/SSE2 - */ + * now have to check for OS support of SSE/SSE2 + */ if(info->data.ia32.fxsr || info->data.ia32.sse || info->data.ia32.sse2) { #if defined FLAC__NO_SSE_OS /* assume user knows better than us; turn it off */ diff --git a/src/lib/libflac/libflac/fixed.c b/src/lib/libflac/libflac/fixed.c index 5871b1f5f5d..0bcdc36fc30 100644 --- a/src/lib/libflac/libflac/fixed.c +++ b/src/lib/libflac/libflac/fixed.c @@ -75,10 +75,10 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ if(err <= n) return 0; /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ + * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. + * These allow us later to know we won't lose too much precision in the + * fixed-point division (err<<fracbits)/n. + */ fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2(err)+1); @@ -87,9 +87,9 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ /* err now holds err/n with fracbits fractional bits */ /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ + * Whittle err down to 16 bits max. 16 significant bits is enough for + * our purposes. + */ FLAC__ASSERT(err > 0); bits = FLAC__bitmath_ilog2(err)+1; if(bits > 16) { @@ -118,16 +118,16 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ return 0; /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ + * The return value must have 16 fractional bits. Since the whole part + * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits + * must be >= -3, these assertion allows us to be able to shift rbps + * left if necessary to get 16 fracbits without losing any bits of the + * whole part of rbps. + * + * There is a slight chance due to accumulated error that the whole part + * will require 6 bits, so we use 6 in the assertion. Really though as + * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. + */ FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); FLAC__ASSERT(fracbits >= -3); @@ -154,10 +154,10 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F if(err <= n) return 0; /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ + * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. + * These allow us later to know we won't lose too much precision in the + * fixed-point division (err<<fracbits)/n. + */ fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2_wide(err)+1); @@ -166,9 +166,9 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F /* err now holds err/n with fracbits fractional bits */ /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ + * Whittle err down to 16 bits max. 16 significant bits is enough for + * our purposes. + */ FLAC__ASSERT(err > 0); bits = FLAC__bitmath_ilog2_wide(err)+1; if(bits > 16) { @@ -197,16 +197,16 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F return 0; /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ + * The return value must have 16 fractional bits. Since the whole part + * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits + * must be >= -3, these assertion allows us to be able to shift rbps + * left if necessary to get 16 fracbits without losing any bits of the + * whole part of rbps. + * + * There is a slight chance due to accumulated error that the whole part + * will require 6 bits, so we use 6 in the assertion. Really though as + * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. + */ FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); FLAC__ASSERT(fracbits >= -3); @@ -290,9 +290,9 @@ unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsig FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]); FLAC__int32 error, save; /* total_error_* are 64-bits to avoid overflow when encoding - * erratic signals when the bits-per-sample and blocksize are - * large. - */ + * erratic signals when the bits-per-sample and blocksize are + * large. + */ FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0; unsigned i, order; diff --git a/src/lib/libflac/libflac/float.c b/src/lib/libflac/libflac/float.c index dc0390eab89..24ea8bc4bf7 100644 --- a/src/lib/libflac/libflac/float.c +++ b/src/lib/libflac/libflac/float.c @@ -57,8 +57,8 @@ const FLAC__fixedpoint FLAC__FP_E = 178145; static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { { /* - * 0 fraction bits - */ + * 0 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000001, /* lg(4/3) = */ 0x00000000, @@ -78,8 +78,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 4 fraction bits - */ + * 4 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000010, /* lg(4/3) = */ 0x00000007, @@ -99,8 +99,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 8 fraction bits - */ + * 8 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000100, /* lg(4/3) = */ 0x0000006a, @@ -120,8 +120,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 12 fraction bits - */ + * 12 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00001000, /* lg(4/3) = */ 0x000006a4, @@ -141,8 +141,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 16 fraction bits - */ + * 16 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00010000, /* lg(4/3) = */ 0x00006a40, @@ -162,8 +162,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 20 fraction bits - */ + * 20 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00100000, /* lg(4/3) = */ 0x0006a3fe, @@ -183,8 +183,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 24 fraction bits - */ + * 24 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x01000000, /* lg(4/3) = */ 0x006a3fe6, @@ -204,8 +204,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 28 fraction bits - */ + * 28 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x10000000, /* lg(4/3) = */ 0x06a3fe5c, @@ -229,8 +229,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { static const FLAC__uint64 log2_lookup_wide[] = { { /* - * 32 fraction bits - */ + * 32 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ FLAC__U64L(0x100000000), /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c6), @@ -250,8 +250,8 @@ static const FLAC__uint64 log2_lookup_wide[] = { }, { /* - * 48 fraction bits - */ + * 48 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ FLAC__U64L(0x1000000000000), /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c60429), @@ -282,7 +282,7 @@ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned p if(x < ONE) return 0; - + if(precision > LOG2_LOOKUP_PRECISION) precision = LOG2_LOOKUP_PRECISION; diff --git a/src/lib/libflac/libflac/lpc.c b/src/lib/libflac/libflac/lpc.c index 3fb80ab8896..1c15e5c0fec 100644 --- a/src/lib/libflac/libflac/lpc.c +++ b/src/lib/libflac/libflac/lpc.c @@ -71,12 +71,12 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le FLAC__ASSERT(lag <= data_len); /* - * Technically we should subtract the mean first like so: - * for(i = 0; i < data_len; i++) - * data[i] -= mean; - * but it appears not to make enough of a difference to matter, and - * most signals are already closely centered around zero - */ + * Technically we should subtract the mean first like so: + * for(i = 0; i < data_len; i++) + * data[i] -= mean; + * but it appears not to make enough of a difference to matter, and + * most signals are already closely centered around zero + */ while(lag--) { for(i = lag, d = 0.0; i < data_len; i++) d += data[i] * data[i - lag]; @@ -85,9 +85,9 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le #endif /* - * this version tends to run faster because of better data locality - * ('data_len' is usually much larger than 'lag') - */ + * this version tends to run faster because of better data locality + * ('data_len' is usually much larger than 'lag') + */ FLAC__real d; unsigned sample, coeff; const unsigned limit = data_len - lag; @@ -223,9 +223,9 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, } } /* negative shift is very rare but due to design flaw, negative shift is - * a NOP in the decoder, so it must be handled specially by scaling down - * coeffs - */ + * a NOP in the decoder, so it must be handled specially by scaling down + * coeffs + */ else { const int nshift = -(*shift); FLAC__double error = 0.0; @@ -297,13 +297,13 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, u } /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - */ + for(i = 0; i < data_len; i++) { + sum = 0; + for(j = 0; j < order; j++) + sum += qlp_coeff[j] * data[i-j-1]; + residual[i] = data[i] - (sum >> lp_quantization); + } + */ } #else /* fully unrolled version for normal use */ { @@ -314,10 +314,10 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, u FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -576,10 +576,10 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *da FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -827,13 +827,13 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c } /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - */ + for(i = 0; i < data_len; i++) { + sum = 0; + for(j = 0; j < order; j++) + sum += qlp_coeff[j] * data[i-j-1]; + data[i] = residual[i] + (sum >> lp_quantization); + } + */ } #else /* fully unrolled version for normal use */ { @@ -844,10 +844,10 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -1106,10 +1106,10 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_l FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { diff --git a/src/lib/libflac/libflac/md5.c b/src/lib/libflac/libflac/md5.c index 37cef67bdc8..70c395bc09a 100644 --- a/src/lib/libflac/libflac/md5.c +++ b/src/lib/libflac/libflac/md5.c @@ -143,7 +143,7 @@ static void byteSwap(FLAC__uint32 *buf, unsigned words) { register FLAC__uint32 x; do { - x = *buf; + x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); } while (--words); diff --git a/src/lib/libflac/libflac/metadata_iterators.c b/src/lib/libflac/libflac/metadata_iterators.c index e8504112b56..4ea6595d352 100644 --- a/src/lib/libflac/libflac/metadata_iterators.c +++ b/src/lib/libflac/libflac/metadata_iterators.c @@ -264,9 +264,9 @@ void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMe (void)decoder; /* - * we assume we only get here when the one metadata block we were - * looking for was passed to us - */ + * we assume we only get here when the one metadata block we were + * looking for was passed to us + */ if(!cd->got_error && 0 == cd->object) { if(0 == (cd->object = FLAC__metadata_object_clone(metadata))) cd->got_error = true; @@ -906,10 +906,10 @@ struct FLAC__Metadata_Chain { FLAC__Metadata_ChainStatus status; off_t first_offset, last_offset; /* - * This is the length of the chain initially read from the FLAC file. - * it is used to compare against the current length to decide whether - * or not the whole file has to be rewritten. - */ + * This is the length of the chain initially read from the FLAC file. + * it is used to compare against the current length to decide whether + * or not the whole file has to be rewritten. + */ off_t initial_length; /* @@@ hacky, these are currently only needed by ogg reader */ FLAC__IOHandle handle; @@ -1613,9 +1613,9 @@ FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_ FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding) { /* This does all the same checks that are in chain_prepare_for_write_() - * but doesn't actually alter the chain. Make sure to update the logic - * here if chain_prepare_for_write_() changes. - */ + * but doesn't actually alter the chain. Make sure to update the logic + * here if chain_prepare_for_write_() changes. + */ const off_t current_length = chain_calculate_length_(chain); FLAC__ASSERT(0 != chain); @@ -1811,9 +1811,9 @@ FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain) FLAC__ASSERT(0 != chain); /* - * Don't try and be too smart... this simple algo is good enough for - * the small number of nodes that we deal with. - */ + * Don't try and be too smart... this simple algo is good enough for + * the small number of nodes that we deal with. + */ for(i = 0, node = chain->head; i < chain->nodes; i++) { if(node->data->type == FLAC__METADATA_TYPE_PADDING) { save = node->next; @@ -1835,9 +1835,9 @@ FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void) FLAC__Metadata_Iterator *iterator = (FLAC__Metadata_Iterator*)calloc(1, sizeof(FLAC__Metadata_Iterator)); /* calloc() implies: - iterator->current = 0; - iterator->chain = 0; - */ + iterator->current = 0; + iterator->chain = 0; + */ return iterator; } @@ -2087,9 +2087,9 @@ FLAC__bool read_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallbac *length = unpack_uint32_(raw_header + 1, 3); /* Note that we don't check: - * if(iterator->type >= FLAC__METADATA_TYPE_UNDEFINED) - * we just will read in an opaque block - */ + * if(iterator->type >= FLAC__METADATA_TYPE_UNDEFINED) + * we just will read in an opaque block + */ return true; } @@ -2126,9 +2126,9 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_streaminfo_cb_(FLAC b = buffer; /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level unpacker and use the - * _STREAMINFO_ constants. - */ + * probably eventually write a bit-level unpacker and use the + * _STREAMINFO_ constants. + */ block->min_blocksize = unpack_uint32_(b, 2); b += 2; block->max_blocksize = unpack_uint32_(b, 2); b += 2; block->min_framesize = unpack_uint32_(b, 3); b += 3; @@ -2555,9 +2555,9 @@ FLAC__bool write_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC_ const unsigned bps1 = block->bits_per_sample - 1; /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level packer and use the - * _STREAMINFO_ constants. - */ + * probably eventually write a bit-level packer and use the + * _STREAMINFO_ constants. + */ pack_uint32_(block->min_blocksize, buffer, 2); pack_uint32_(block->max_blocksize, buffer+2, 2); pack_uint32_(block->min_framesize, buffer+4, 3); @@ -3066,11 +3066,11 @@ FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *ite if(fixup_is_last_code != 0) { /* - * if code == 1, it means a block was appended to the end so - * we have to clear the is_last flag of the previous block - * if code == -1, it means the last block was deleted so - * we have to set the is_last flag of the previous block - */ + * if code == 1, it means a block was appended to the end so + * we have to clear the is_last flag of the previous block + * if code == -1, it means the last block was deleted so + * we have to set the is_last flag of the previous block + */ /* MAGIC NUMBERs here; we know the is_last flag is the high bit of the byte at this location */ FLAC__byte x; if(0 != fseeko(*tempfile, fixup_is_last_flag_offset, SEEK_SET)) { diff --git a/src/lib/libflac/libflac/metadata_object.c b/src/lib/libflac/libflac/metadata_object.c index 253c4ba785e..f00e0d597f5 100644 --- a/src/lib/libflac/libflac/metadata_object.c +++ b/src/lib/libflac/libflac/metadata_object.c @@ -268,13 +268,13 @@ static FLAC__bool vorbiscomment_set_entry_(FLAC__StreamMetadata *object, FLAC__S /* we have to make sure that the string we're taking over is null-terminated */ /* - * Stripping the const from src->entry is OK since we're taking - * ownership of the pointer. This is a hack around a deficiency - * in the API where the same function is used for 'copy' and - * 'own', but the source entry is a const pointer. If we were - * precise, the 'own' flavor would be a separate function with a - * non-const source pointer. But it's not, so we hack away. - */ + * Stripping the const from src->entry is OK since we're taking + * ownership of the pointer. This is a hack around a deficiency + * in the API where the same function is used for 'copy' and + * 'own', but the source entry is a const pointer. If we were + * precise, the 'own' flavor would be a separate function with a + * non-const source pointer. But it's not, so we hack away. + */ if(!ensure_null_terminated_((FLAC__byte**)(&src->entry), src->length)) return false; *dest = *src; @@ -447,21 +447,21 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type break; case FLAC__METADATA_TYPE_PADDING: /* calloc() took care of this for us: - object->length = 0; - */ + object->length = 0; + */ break; case FLAC__METADATA_TYPE_APPLICATION: object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; /* calloc() took care of this for us: - object->data.application.data = 0; - */ + object->data.application.data = 0; + */ break; case FLAC__METADATA_TYPE_SEEKTABLE: /* calloc() took care of this for us: - object->length = 0; - object->data.seek_table.num_points = 0; - object->data.seek_table.points = 0; - */ + object->length = 0; + object->data.seek_table.num_points = 0; + object->data.seek_table.points = 0; + */ break; case FLAC__METADATA_TYPE_VORBIS_COMMENT: object->data.vorbis_comment.vendor_string.length = (unsigned)strlen(FLAC__VENDOR_STRING); @@ -490,13 +490,13 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type object->data.picture.mime_type = 0; object->data.picture.description = 0; /* calloc() took care of this for us: - object->data.picture.width = 0; - object->data.picture.height = 0; - object->data.picture.depth = 0; - object->data.picture.colors = 0; - object->data.picture.data_length = 0; - object->data.picture.data = 0; - */ + object->data.picture.width = 0; + object->data.picture.height = 0; + object->data.picture.depth = 0; + object->data.picture.colors = 0; + object->data.picture.data_length = 0; + object->data.picture.data = 0; + */ /* now initialize mime_type and description with empty strings to make things easier on the client */ if(!copy_cstring_(&object->data.picture.mime_type, "")) { free(object); @@ -511,9 +511,9 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type break; default: /* calloc() took care of this for us: - object->length = 0; - object->data.unknown.data = 0; - */ + object->length = 0; + object->data.unknown.data = 0; + */ break; } } @@ -1330,7 +1330,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pa memcpy(entry->entry+nn+1, field_value, nv); entry->entry[entry->length] = '\0'; } - + return true; } diff --git a/src/lib/libflac/libflac/stream_decoder.c b/src/lib/libflac/libflac/stream_decoder.c index 17bebd08e1f..131501914c8 100644 --- a/src/lib/libflac/libflac/stream_decoder.c +++ b/src/lib/libflac/libflac/stream_decoder.c @@ -398,8 +398,8 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_( #endif /* - * get the CPU info and set the function pointers - */ + * get the CPU info and set the function pointers + */ FLAC__cpu_info(&decoder->private_->cpuinfo); /* first default to the non-asm routines */ decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal; @@ -547,10 +547,10 @@ static FLAC__StreamDecoderInitStatus init_FILE_internal_( return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS; /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ + * To make sure that our file does not go unclosed after an error, we + * must assign the FILE pointer before any further error can occur in + * this routine. + */ if(file == stdin) file = get_binary_stdin_(); /* just to be safe */ @@ -610,10 +610,10 @@ static FLAC__StreamDecoderInitStatus init_file_internal_( FLAC__ASSERT(0 != decoder); /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_decoder_init_FILE() before the FILE* is assigned. - */ + * To make sure that our file does not go unclosed after an error, we + * have to do the same entrance checks here that are later performed + * in FLAC__stream_decoder_init_FILE() before the FILE* is assigned. + */ if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED; @@ -665,8 +665,8 @@ FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder) return true; /* see the comment in FLAC__seekable_stream_decoder_reset() as to why we - * always call FLAC__MD5Final() - */ + * always call FLAC__MD5Final() + */ FLAC__MD5Final(decoder->private_->computed_md5sum, &decoder->private_->md5context); if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) { @@ -677,11 +677,11 @@ FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder) FLAC__bitreader_free(decoder->private_->input); for(i = 0; i < FLAC__MAX_CHANNELS; i++) { /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ + * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the + * output arrays have a buffer of up to 3 zeroes in front + * (at negative indices) for alignment purposes; we use 4 + * to keep the data well-aligned. + */ if(0 != decoder->private_->output[i]) { free(decoder->private_->output[i]-4); decoder->private_->output[i] = 0; @@ -985,10 +985,10 @@ FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder) #endif /* Rewind if necessary. If FLAC__stream_decoder_init() is calling us, - * (internal_reset_hack) don't try to rewind since we are already at - * the beginning of the stream and don't want to fail if the input is - * not seekable. - */ + * (internal_reset_hack) don't try to rewind since we are already at + * the beginning of the stream and don't want to fail if the input is + * not seekable. + */ if(!decoder->private_->internal_reset_hack) { if(decoder->private_->file == stdin) return false; /* can't rewind stdin, reset fails */ @@ -1008,17 +1008,17 @@ FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder) } decoder->private_->do_md5_checking = decoder->protected_->md5_checking; /* - * This goes in reset() and not flush() because according to the spec, a - * fixed-blocksize stream must stay that way through the whole stream. - */ + * This goes in reset() and not flush() because according to the spec, a + * fixed-blocksize stream must stay that way through the whole stream. + */ decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0; /* We initialize the FLAC__MD5Context even though we may never use it. This - * is because md5 checking may be turned on to start and then turned off if - * a seek occurs. So we init the context here and finalize it in - * FLAC__stream_decoder_finish() to make sure things are always cleaned up - * properly. - */ + * is because md5 checking may be turned on to start and then turned off if + * a seek occurs. So we init the context here and finalize it in + * FLAC__stream_decoder_finish() to make sure things are always cleaned up + * properly. + */ FLAC__MD5Init(&decoder->private_->md5context); decoder->private_->first_frame_offset = 0; @@ -1276,12 +1276,12 @@ FILE *get_binary_stdin_(void) { #if 0 /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ + * absence of an underscore before the identifiers 'setmode', + * 'fileno', and/or 'O_BINARY'; check your system header files. + */ #if defined _MSC_VER || defined __MINGW32__ _setmode(_fileno(stdin), _O_BINARY); -#elif defined __CYGWIN__ +#elif defined __CYGWIN__ /* almost certainly not needed for any modern Cygwin, but let's be safe... */ setmode(_fileno(stdin), _O_BINARY); #elif defined __EMX__ @@ -1314,11 +1314,11 @@ FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigne for(i = 0; i < channels; i++) { /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ + * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the + * output arrays have a buffer of up to 3 zeroes in front + * (at negative indices) for alignment purposes; we use 4 + * to keep the data well-aligned. + */ tmp = (FLAC__int32*)safe_malloc_muladd2_(sizeof(FLAC__int32), /*times (*/size, /*+*/4/*)*/); if(tmp == 0) { decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; @@ -1328,8 +1328,8 @@ FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigne decoder->private_->output[i] = tmp + 4; /* WATCHOUT: - * minimum of quadword alignment for PPC vector optimizations is REQUIRED: - */ + * minimum of quadword alignment for PPC vector optimizations is REQUIRED: + */ if(!FLAC__memory_alloc_aligned_int32_array(size, &decoder->private_->residual_unaligned[i], &decoder->private_->residual[i])) { decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; return false; @@ -2009,8 +2009,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL return false; for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) { /* - * first figure the correct bits-per-sample of the subframe - */ + * first figure the correct bits-per-sample of the subframe + */ unsigned bps = decoder->private_->frame.header.bits_per_sample; switch(decoder->private_->frame.header.channel_assignment) { case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: @@ -2035,8 +2035,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL FLAC__ASSERT(0); } /* - * now read it - */ + * now read it + */ if(!read_subframe_(decoder, channel, bps, do_full_decode)) return false; if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption */ @@ -2048,8 +2048,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL return true; /* - * Read the frame CRC-16 from the footer and check - */ + * Read the frame CRC-16 from the footer and check + */ frame_crc = FLAC__bitreader_get_read_crc16(decoder->private_->input); if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__FRAME_FOOTER_CRC_LEN)) return false; /* read_callback_ sets the state for us */ @@ -2151,27 +2151,27 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) is_unparseable = true; /* - * Note that along the way as we read the header, we look for a sync - * code inside. If we find one it would indicate that our original - * sync was bad since there cannot be a sync code in a valid header. - * - * Three kinds of things can go wrong when reading the frame header: - * 1) We may have sync'ed incorrectly and not landed on a frame header. - * If we don't find a sync code, it can end up looking like we read - * a valid but unparseable header, until getting to the frame header - * CRC. Even then we could get a false positive on the CRC. - * 2) We may have sync'ed correctly but on an unparseable frame (from a - * future encoder). - * 3) We may be on a damaged frame which appears valid but unparseable. - * - * For all these reasons, we try and read a complete frame header as - * long as it seems valid, even if unparseable, up until the frame - * header CRC. - */ + * Note that along the way as we read the header, we look for a sync + * code inside. If we find one it would indicate that our original + * sync was bad since there cannot be a sync code in a valid header. + * + * Three kinds of things can go wrong when reading the frame header: + * 1) We may have sync'ed incorrectly and not landed on a frame header. + * If we don't find a sync code, it can end up looking like we read + * a valid but unparseable header, until getting to the frame header + * CRC. Even then we could get a false positive on the CRC. + * 2) We may have sync'ed correctly but on an unparseable frame (from a + * future encoder). + * 3) We may be on a damaged frame which appears valid but unparseable. + * + * For all these reasons, we try and read a complete frame header as + * long as it seems valid, even if unparseable, up until the frame + * header CRC. + */ /* - * read in the raw header as bytes so we can CRC it, and parse it on the way - */ + * read in the raw header as bytes so we can CRC it, and parse it on the way + */ for(i = 0; i < 2; i++) { if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) return false; /* read_callback_ sets the state for us */ @@ -2462,8 +2462,8 @@ FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsign decoder->private_->frame.subframes[channel].wasted_bits = 0; /* - * Lots of magic numbers here - */ + * Lots of magic numbers here + */ if(x & 0x80) { send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; @@ -2663,8 +2663,8 @@ FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, un if(do_full_decode) { memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order); /*@@@@@@ technically not pessimistic enough, should be more like - if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1) << 32) ) - */ + if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1) << 32) ) + */ if(bps + subframe->qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32) if(bps <= 16 && subframe->qlp_coeff_precision <= 16) { if(order <= 8) @@ -2793,15 +2793,15 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) } else if(*bytes > 0) { /* While seeking, it is possible for our seek to land in the - * middle of audio data that looks exactly like a frame header - * from a future version of an encoder. When that happens, our - * error callback will get an - * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its - * unparseable_frame_count. But there is a remote possibility - * that it is properly synced at such a "future-codec frame", - * so to make sure, we wait to see many "unparseable" errors in - * a row before bailing out. - */ + * middle of audio data that looks exactly like a frame header + * from a future version of an encoder. When that happens, our + * error callback will get an + * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its + * unparseable_frame_count. But there is a remote possibility + * that it is properly synced at such a "future-codec frame", + * so to make sure, we wait to see many "unparseable" errors in + * a row before bailing out. + */ if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) { decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; return false; @@ -2845,15 +2845,15 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) return false; } /* [1] @@@ HACK NOTE: The end-of-stream checking has to be hacked around - * for Ogg FLAC. This is because the ogg decoder aspect can lose sync - * and at the same time hit the end of the stream (for example, seeking - * to a point that is after the beginning of the last Ogg page). There - * is no way to report an Ogg sync loss through the callbacks (see note - * in read_callback_ogg_aspect_()) so it returns CONTINUE with *bytes==0. - * So to keep the decoder from stopping at this point we gate the call - * to the eof_callback and let the Ogg decoder aspect set the - * end-of-stream state when it is needed. - */ + * for Ogg FLAC. This is because the ogg decoder aspect can lose sync + * and at the same time hit the end of the stream (for example, seeking + * to a point that is after the beginning of the last Ogg page). There + * is no way to report an Ogg sync loss through the callbacks (see note + * in read_callback_ogg_aspect_()) so it returns CONTINUE with *bytes==0. + * So to keep the decoder from stopping at this point we gate the call + * to the eof_callback and let the Ogg decoder aspect set the + * end-of-stream state when it is needed. + */ } #if FLAC__HAS_OGG @@ -2863,9 +2863,9 @@ FLAC__StreamDecoderReadStatus read_callback_ogg_aspect_(const FLAC__StreamDecode case FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK: return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; /* we don't really have a way to handle lost sync via read - * callback so we'll let it pass and let the underlying - * FLAC decoder catch the error - */ + * callback so we'll let it pass and let the underlying + * FLAC decoder catch the error + */ case FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC: return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; case FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM: @@ -2941,9 +2941,9 @@ FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_(FLAC__StreamDecoder } else { /* - * If we never got STREAMINFO, turn off MD5 checking to save - * cycles since we don't have a sum to compare to anyway - */ + * If we never got STREAMINFO, turn off MD5 checking to save + * cycles since we don't have a sum to compare to anyway + */ if(!decoder->private_->has_stream_info) decoder->private_->do_md5_checking = false; if(decoder->private_->do_md5_checking) { @@ -2989,11 +2989,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s if(max_framesize > 0) approx_bytes_per_frame = (max_framesize + min_framesize) / 2 + 1; /* - * Check if it's a known fixed-blocksize stream. Note that though - * the spec doesn't allow zeroes in the STREAMINFO block, we may - * never get a STREAMINFO block when decoding so the value of - * min_blocksize might be zero. - */ + * Check if it's a known fixed-blocksize stream. Note that though + * the spec doesn't allow zeroes in the STREAMINFO block, we may + * never get a STREAMINFO block when decoding so the value of + * min_blocksize might be zero. + */ else if(min_blocksize == max_blocksize && min_blocksize > 0) { /* note there are no () around 'bps/8' to keep precision up since it's an integer calulation */ approx_bytes_per_frame = min_blocksize * channels * bps/8 + 64; @@ -3002,24 +3002,24 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s approx_bytes_per_frame = 4096 * channels * bps/8 + 64; /* - * First, we set an upper and lower bound on where in the - * stream we will search. For now we assume the worst case - * scenario, which is our best guess at the beginning of - * the first frame and end of the stream. - */ + * First, we set an upper and lower bound on where in the + * stream we will search. For now we assume the worst case + * scenario, which is our best guess at the beginning of + * the first frame and end of the stream. + */ lower_bound = first_frame_offset; lower_bound_sample = 0; upper_bound = stream_length; upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/; /* - * Now we refine the bounds if we have a seektable with - * suitable points. Note that according to the spec they - * must be ordered by ascending sample number. - * - * Note: to protect against invalid seek tables we will ignore points - * that have frame_samples==0 or sample_number>=total_samples - */ + * Now we refine the bounds if we have a seektable with + * suitable points. Note that according to the spec they + * must be ordered by ascending sample number. + * + * Note: to protect against invalid seek tables we will ignore points + * that have frame_samples==0 or sample_number>=total_samples + */ if(seek_table) { FLAC__uint64 new_lower_bound = lower_bound; FLAC__uint64 new_upper_bound = upper_bound; @@ -3066,14 +3066,14 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s FLAC__ASSERT(upper_bound_sample >= lower_bound_sample); /* there are 2 insidious ways that the following equality occurs, which - * we need to fix: - * 1) total_samples is 0 (unknown) and target_sample is 0 - * 2) total_samples is 0 (unknown) and target_sample happens to be - * exactly equal to the last seek point in the seek table; this - * means there is no seek point above it, and upper_bound_samples - * remains equal to the estimate (of target_samples) we made above - * in either case it does not hurt to move upper_bound_sample up by 1 - */ + * we need to fix: + * 1) total_samples is 0 (unknown) and target_sample is 0 + * 2) total_samples is 0 (unknown) and target_sample happens to be + * exactly equal to the last seek point in the seek table; this + * means there is no seek point above it, and upper_bound_samples + * remains equal to the estimate (of target_samples) we made above + * in either case it does not hurt to move upper_bound_sample up by 1 + */ if(upper_bound_sample == lower_bound_sample) upper_bound_sample++; @@ -3111,11 +3111,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s return false; } /* Now we need to get a frame. First we need to reset our - * unparseable_frame_count; if we get too many unparseable - * frames in a row, the read callback will return - * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing - * FLAC__stream_decoder_process_single() to return false. - */ + * unparseable_frame_count; if we get too many unparseable + * frames in a row, the read callback will return + * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing + * FLAC__stream_decoder_process_single() to return false. + */ decoder->private_->unparseable_frame_count = 0; if(!FLAC__stream_decoder_process_single(decoder)) { decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; @@ -3142,11 +3142,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s } /* our last move backwards wasn't big enough, try again */ approx_bytes_per_frame = approx_bytes_per_frame? approx_bytes_per_frame * 2 : 16; - continue; + continue; } /* allow one seek over upper bound, so we can get a correct upper_bound_sample for streams with unknown total_samples */ first_seek = false; - + /* make sure we are not seeking in corrupted stream */ if (this_frame_sample < lower_bound_sample) { decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; @@ -3186,21 +3186,21 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint FLAC__bool did_a_seek; unsigned iteration = 0; - /* In the first iterations, we will calculate the target byte position - * by the distance from the target sample to left_sample and - * right_sample (let's call it "proportional search"). After that, we - * will switch to binary search. - */ + /* In the first iterations, we will calculate the target byte position + * by the distance from the target sample to left_sample and + * right_sample (let's call it "proportional search"). After that, we + * will switch to binary search. + */ unsigned BINARY_SEARCH_AFTER_ITERATION = 2; /* We will switch to a linear search once our current sample is less - * than this number of samples ahead of the target sample - */ + * than this number of samples ahead of the target sample + */ static const FLAC__uint64 LINEAR_SEARCH_WITHIN_SAMPLES = FLAC__MAX_BLOCK_SIZE * 2; /* If the total number of samples is unknown, use a large value, and - * force binary search immediately. - */ + * force binary search immediately. + */ if(right_sample == 0) { right_sample = (FLAC__uint64)(-1); BINARY_SEARCH_AFTER_ITERATION = 0; @@ -3228,10 +3228,10 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint pos = (FLAC__int64)((((target_sample-left_sample)>>8) * ((right_pos-left_pos)>>8)) / ((right_sample-left_sample)>>16)); #endif /* @@@ TODO: might want to limit pos to some distance - * before EOF, to make sure we land before the last frame, - * thereby getting a this_frame_sample and so having a better - * estimate. - */ + * before EOF, to make sure we land before the last frame, + * thereby getting a this_frame_sample and so having a better + * estimate. + */ } /* physical seek */ @@ -3256,16 +3256,16 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint if(!decoder->private_->got_a_frame) { if(did_a_seek) { /* this can happen if we seek to a point after the last frame; we drop - * to binary search right away in this case to avoid any wasted - * iterations of proportional search. - */ + * to binary search right away in this case to avoid any wasted + * iterations of proportional search. + */ right_pos = pos; BINARY_SEARCH_AFTER_ITERATION = 0; } else { /* this can probably only happen if total_samples is unknown and the - * target_sample is past the end of the stream - */ + * target_sample is past the end of the stream + */ decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; return false; } @@ -3281,11 +3281,11 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint if (did_a_seek) { if (this_frame_sample <= target_sample) { /* The 'equal' case should not happen, since - * FLAC__stream_decoder_process_single() - * should recognize that it has hit the - * target sample and we would exit through - * the 'break' above. - */ + * FLAC__stream_decoder_process_single() + * should recognize that it has hit the + * target sample and we would exit through + * the 'break' above. + */ FLAC__ASSERT(this_frame_sample != target_sample); left_sample = this_frame_sample; diff --git a/src/lib/libflac/libflac/stream_encoder.c b/src/lib/libflac/libflac/stream_encoder.c index bb619126489..cb71f134e12 100644 --- a/src/lib/libflac/libflac/stream_encoder.c +++ b/src/lib/libflac/libflac/stream_encoder.c @@ -88,7 +88,7 @@ * parameter estimation in this encoder is very good, almost always * yielding compression within 0.1% of the optimal parameters. */ -#undef ENABLE_RICE_PARAMETER_SEARCH +#undef ENABLE_RICE_PARAMETER_SEARCH typedef struct { @@ -224,7 +224,7 @@ static unsigned evaluate_lpc_subframe_( #endif static unsigned evaluate_verbatim_subframe_( - FLAC__StreamEncoder *encoder, + FLAC__StreamEncoder *encoder, const FLAC__int32 signal[], unsigned blocksize, unsigned subframe_bps, @@ -406,16 +406,16 @@ typedef struct FLAC__StreamEncoderPrivate { FLAC__uint64 *abs_residual_partition_sums_unaligned; unsigned *raw_bits_per_partition_unaligned; /* - * These fields have been moved here from private function local - * declarations merely to save stack space during encoding. - */ + * These fields have been moved here from private function local + * declarations merely to save stack space during encoding. + */ #ifndef FLAC__INTEGER_ONLY_LIBRARY FLAC__real lp_coeff[FLAC__MAX_LPC_ORDER][FLAC__MAX_LPC_ORDER]; /* from process_subframe_() */ #endif FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents_extra[2]; /* from find_best_partition_order_() */ /* - * The data for the verify section - */ + * The data for the verify section + */ struct { FLAC__StreamDecoder *decoder; EncoderStateHint state_hint; @@ -825,7 +825,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( metadata_picture_has_type1 = true; /* standard icon must be 32x32 pixel PNG */ if( - m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && + m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && ( (strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) || m->data.picture.width != 32 || @@ -894,8 +894,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->use_wide_by_partition = (false); /*@@@ need to set this */ /* - * get the CPU info and set the function pointers - */ + * get the CPU info and set the function pointers + */ FLAC__cpu_info(&encoder->private_->cpuinfo); /* first default to the non-asm routines */ #ifndef FLAC__INTEGER_ONLY_LIBRARY @@ -977,13 +977,13 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * Set up the verify stuff if necessary - */ + * Set up the verify stuff if necessary + */ if(encoder->protected_->verify) { /* - * First, set up the fifo which will hold the - * original signal to compare against - */ + * First, set up the fifo which will hold the + * original signal to compare against + */ encoder->private_->verify.input_fifo.size = encoder->protected_->blocksize+OVERREAD_; for(i = 0; i < encoder->protected_->channels; i++) { if(0 == (encoder->private_->verify.input_fifo.data[i] = (FLAC__int32*)safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size))) { @@ -994,8 +994,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->verify.input_fifo.tail = 0; /* - * Now set up a stream decoder for verification - */ + * Now set up a stream decoder for verification + */ encoder->private_->verify.decoder = FLAC__stream_decoder_new(); if(0 == encoder->private_->verify.decoder) { encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; @@ -1015,9 +1015,9 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->verify.error_stats.got = 0; /* - * These must be done before we write any metadata, because that - * calls the write_callback, which uses these values. - */ + * These must be done before we write any metadata, because that + * calls the write_callback, which uses these values. + */ encoder->private_->first_seekpoint_to_check = 0; encoder->private_->samples_written = 0; encoder->protected_->streaminfo_offset = 0; @@ -1025,8 +1025,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->protected_->audio_offset = 0; /* - * write the stream header - */ + * write the stream header + */ if(encoder->protected_->verify) encoder->private_->verify.state_hint = ENCODER_IN_MAGIC; if(!FLAC__bitwriter_write_raw_uint32(encoder->private_->frame, FLAC__STREAM_SYNC, FLAC__STREAM_SYNC_LEN)) { @@ -1039,8 +1039,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * write the STREAMINFO metadata block - */ + * write the STREAMINFO metadata block + */ if(encoder->protected_->verify) encoder->private_->verify.state_hint = ENCODER_IN_METADATA; encoder->private_->streaminfo.type = FLAC__METADATA_TYPE_STREAMINFO; @@ -1067,23 +1067,23 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * Now that the STREAMINFO block is written, we can init this to an - * absurdly-high value... - */ + * Now that the STREAMINFO block is written, we can init this to an + * absurdly-high value... + */ encoder->private_->streaminfo.data.stream_info.min_framesize = (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN) - 1; /* ... and clear this to 0 */ encoder->private_->streaminfo.data.stream_info.total_samples = 0; /* - * Check to see if the supplied metadata contains a VORBIS_COMMENT; - * if not, we will write an empty one (FLAC__add_metadata_block() - * automatically supplies the vendor string). - * - * WATCHOUT: the Ogg FLAC mapping requires us to write this block after - * the STREAMINFO. (In the case that metadata_has_vorbis_comment is - * true it will have already insured that the metadata list is properly - * ordered.) - */ + * Check to see if the supplied metadata contains a VORBIS_COMMENT; + * if not, we will write an empty one (FLAC__add_metadata_block() + * automatically supplies the vendor string). + * + * WATCHOUT: the Ogg FLAC mapping requires us to write this block after + * the STREAMINFO. (In the case that metadata_has_vorbis_comment is + * true it will have already insured that the metadata list is properly + * ordered.) + */ if(!metadata_has_vorbis_comment) { FLAC__StreamMetadata vorbis_comment; vorbis_comment.type = FLAC__METADATA_TYPE_VORBIS_COMMENT; @@ -1104,8 +1104,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * write the user's metadata blocks - */ + * write the user's metadata blocks + */ for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { encoder->protected_->metadata[i]->is_last = (i == encoder->protected_->num_metadata_blocks - 1); if(!FLAC__add_metadata_block(encoder->protected_->metadata[i], encoder->private_->frame)) { @@ -1172,7 +1172,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream( /*is_ogg=*/true ); } - + static FLAC__StreamEncoderInitStatus init_FILE_internal_( FLAC__StreamEncoder *encoder, FILE *file, @@ -1196,10 +1196,10 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_( } /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ + * To make sure that our file does not go unclosed after an error, we + * must assign the FILE pointer before any further error can occur in + * this routine. + */ if(file == stdout) file = get_binary_stdout_(); /* just to be safe */ @@ -1234,7 +1234,7 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_( return init_status; } - + FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE( FLAC__StreamEncoder *encoder, FILE *file, @@ -1244,7 +1244,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE( { return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/false); } - + FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE( FLAC__StreamEncoder *encoder, FILE *file, @@ -1268,10 +1268,10 @@ static FLAC__StreamEncoderInitStatus init_file_internal_( FLAC__ASSERT(0 != encoder); /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_encoder_init_FILE() before the FILE* is assigned. - */ + * To make sure that our file does not go unclosed after an error, we + * have to do the same entrance checks here that are later performed + * in FLAC__stream_encoder_init_FILE() before the FILE* is assigned. + */ if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED; @@ -2033,13 +2033,13 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder j = k = 0; /* - * we have several flavors of the same basic loop, optimized for - * different conditions: - */ + * we have several flavors of the same basic loop, optimized for + * different conditions: + */ if(encoder->protected_->do_mid_side_stereo && channels == 2) { /* - * stereo coding: unroll channel loop - */ + * stereo coding: unroll channel loop + */ do { if(encoder->protected_->verify) append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); @@ -2073,8 +2073,8 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder } else { /* - * independent channel coding: buffer each channel in inner loop - */ + * independent channel coding: buffer each channel in inner loop + */ do { if(encoder->protected_->verify) append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); @@ -2259,10 +2259,10 @@ FLAC__bool resize_buffers_(FLAC__StreamEncoder *encoder, unsigned new_blocksize) ok = true; /* WATCHOUT: FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx() - * requires that the input arrays (in our case the integer signals) - * have a buffer of up to 3 zeroes in front (at negative indices) for - * alignment purposes; we use 4 in front to keep the data well-aligned. - */ + * requires that the input arrays (in our case the integer signals) + * have a buffer of up to 3 zeroes in front (at negative indices) for + * alignment purposes; we use 4 in front to keep the data well-aligned. + */ for(i = 0; ok && i < encoder->protected_->channels; i++) { ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize+4+OVERREAD_, &encoder->private_->integer_signal_unaligned[i], &encoder->private_->integer_signal[i]); @@ -2436,8 +2436,8 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const } /* - * Watch for the STREAMINFO block and first SEEKTABLE block to go by and store their offsets. - */ + * Watch for the STREAMINFO block and first SEEKTABLE block to go by and store their offsets. + */ if(samples == 0) { FLAC__MetadataType type = (buffer[0] & 0x7f); if(type == FLAC__METADATA_TYPE_STREAMINFO) @@ -2447,10 +2447,10 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const } /* - * Mark the current seek point if hit (if audio_offset == 0 that - * means we're still writing metadata and haven't hit the first - * frame yet) - */ + * Mark the current seek point if hit (if audio_offset == 0 that + * means we're still writing metadata and haven't hit the first + * frame yet) + */ if(0 != encoder->private_->seek_table && encoder->protected_->audio_offset > 0 && encoder->private_->seek_table->num_points > 0) { const unsigned blocksize = FLAC__stream_encoder_get_blocksize(encoder); const FLAC__uint64 frame_first_sample = encoder->private_->samples_written; @@ -2468,11 +2468,11 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const encoder->private_->seek_table->points[i].frame_samples = blocksize; encoder->private_->first_seekpoint_to_check++; /* DO NOT: "break;" and here's why: - * The seektable template may contain more than one target - * sample for any given frame; we will keep looping, generating - * duplicate seekpoints for them, and we'll clean it up later, - * just before writing the seektable back to the metadata. - */ + * The seektable template may contain more than one target + * sample for any given frame; we will keep looping, generating + * duplicate seekpoints for them, and we'll clean it up later, + * just before writing the seektable back to the metadata. + */ } else { encoder->private_->first_seekpoint_to_check++; @@ -2502,9 +2502,9 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const encoder->private_->bytes_written += bytes; encoder->private_->samples_written += samples; /* we keep a high watermark on the number of frames written because - * when the encoder goes back to write metadata, 'current_frame' - * will drop back to 0. - */ + * when the encoder goes back to write metadata, 'current_frame' + * will drop back to 0. + */ encoder->private_->frames_written = max(encoder->private_->frames_written, encoder->private_->current_frame_number+1); } else @@ -2527,13 +2527,13 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) FLAC__ASSERT(metadata->type == FLAC__METADATA_TYPE_STREAMINFO); /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ + * layout, but a change to the header format that would break this + * would also break all streams encoded in the previous format. + */ /* - * Write MD5 signature - */ + * Write MD5 signature + */ { const unsigned md5_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2560,8 +2560,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write total samples - */ + * Write total samples + */ { const unsigned total_samples_byte_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2593,8 +2593,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write min/max framesize - */ + * Write min/max framesize + */ { const unsigned min_framesize_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2621,8 +2621,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write seektable - */ + * Write seektable + */ if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { unsigned i; @@ -2692,19 +2692,19 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) FLAC__ASSERT(0 != encoder->private_->seek_callback); /* Pre-check that client supports seeking, since we don't want the - * ogg_helper code to ever have to deal with this condition. - */ + * ogg_helper code to ever have to deal with this condition. + */ if(encoder->private_->seek_callback(encoder, 0, encoder->private_->client_data) == FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED) return; /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ + * layout, but a change to the header format that would break this + * would also break all streams encoded in the previous format. + */ /** - ** Write STREAMINFO stats - **/ + ** Write STREAMINFO stats + **/ simple_ogg_page__init(&page); if(!simple_ogg_page__get_at(encoder, encoder->protected_->streaminfo_offset, &page, encoder->private_->seek_callback, encoder->private_->read_callback, encoder->private_->client_data)) { simple_ogg_page__clear(&page); @@ -2712,8 +2712,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write MD5 signature - */ + * Write MD5 signature + */ { const unsigned md5_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2738,8 +2738,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write total samples - */ + * Write total samples + */ { const unsigned total_samples_byte_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2770,8 +2770,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write min/max framesize - */ + * Write min/max framesize + */ { const unsigned min_framesize_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2801,8 +2801,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) simple_ogg_page__clear(&page); /* - * Write seektable - */ + * Write seektable + */ if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { unsigned i; FLAC__byte *p; @@ -2865,32 +2865,32 @@ FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); /* - * Accumulate raw signal to the MD5 signature - */ + * Accumulate raw signal to the MD5 signature + */ if(encoder->protected_->do_md5 && !FLAC__MD5Accumulate(&encoder->private_->md5context, (const FLAC__int32 * const *)encoder->private_->integer_signal, encoder->protected_->channels, encoder->protected_->blocksize, (encoder->protected_->bits_per_sample+7) / 8)) { encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; return false; } /* - * Process the frame header and subframes into the frame bitbuffer - */ + * Process the frame header and subframes into the frame bitbuffer + */ if(!process_subframes_(encoder, is_fractional_block)) { /* the above function sets the state for us in case of an error */ return false; } /* - * Zero-pad the frame to a byte_boundary - */ + * Zero-pad the frame to a byte_boundary + */ if(!FLAC__bitwriter_zero_pad_to_byte_boundary(encoder->private_->frame)) { encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; return false; } /* - * CRC-16 the whole thing - */ + * CRC-16 the whole thing + */ FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(encoder->private_->frame)); if( !FLAC__bitwriter_get_write_crc16(encoder->private_->frame, &crc) || @@ -2901,16 +2901,16 @@ FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional } /* - * Write it - */ + * Write it + */ if(!write_bitbuffer_(encoder, encoder->protected_->blocksize, is_last_block)) { /* the above function sets the state for us in case of an error */ return false; } /* - * Get ready for the next frame - */ + * Get ready for the next frame + */ encoder->private_->current_sample_number = 0; encoder->private_->current_frame_number++; encoder->private_->streaminfo.data.stream_info.total_samples += (FLAC__uint64)encoder->protected_->blocksize; @@ -2925,8 +2925,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti FLAC__bool do_independent, do_mid_side; /* - * Calculate the min,max Rice partition orders - */ + * Calculate the min,max Rice partition orders + */ if(is_fractional_block) { max_partition_order = 0; } @@ -2937,8 +2937,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti min_partition_order = min(min_partition_order, max_partition_order); /* - * Setup the frame - */ + * Setup the frame + */ frame_header.blocksize = encoder->protected_->blocksize; frame_header.sample_rate = encoder->protected_->sample_rate; frame_header.channels = encoder->protected_->channels; @@ -2948,8 +2948,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti frame_header.number.frame_number = encoder->private_->current_frame_number; /* - * Figure out what channel assignments to try - */ + * Figure out what channel assignments to try + */ if(encoder->protected_->do_mid_side_stereo) { if(encoder->protected_->loose_mid_side_stereo) { if(encoder->private_->loose_mid_side_stereo_frame_count == 0) { @@ -2974,8 +2974,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti FLAC__ASSERT(do_independent || do_mid_side); /* - * Check for wasted bits; set effective bps for each subframe - */ + * Check for wasted bits; set effective bps for each subframe + */ if(do_independent) { for(channel = 0; channel < encoder->protected_->channels; channel++) { const unsigned w = get_wasted_bits_(encoder->private_->integer_signal[channel], encoder->protected_->blocksize); @@ -2993,8 +2993,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * First do a normal encoding pass of each independent channel - */ + * First do a normal encoding pass of each independent channel + */ if(do_independent) { for(channel = 0; channel < encoder->protected_->channels; channel++) { if(! @@ -3017,8 +3017,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * Now do mid and side channels if requested - */ + * Now do mid and side channels if requested + */ if(do_mid_side) { FLAC__ASSERT(encoder->protected_->channels == 2); @@ -3043,8 +3043,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * Compose the frame bitbuffer - */ + * Compose the frame bitbuffer + */ if(do_mid_side) { unsigned left_bps = 0, right_bps = 0; /* initialized only to prevent superfluous compiler warning */ FLAC__Subframe *left_subframe = 0, *right_subframe = 0; /* initialized only to prevent superfluous compiler warning */ @@ -3734,9 +3734,9 @@ unsigned find_best_partition_order_( { /* - * We are allowed to de-const the pointer based on our special - * knowledge; it is const to the outside world. - */ + * We are allowed to de-const the pointer based on our special + * knowledge; it is const to the outside world. + */ FLAC__EntropyCodingMethod_PartitionedRiceContents* prc = (FLAC__EntropyCodingMethod_PartitionedRiceContents*)best_ecm->data.partitioned_rice.contents; unsigned partition; @@ -3746,10 +3746,10 @@ unsigned find_best_partition_order_( if(do_escape_coding) memcpy(prc->raw_bits, private_->partitioned_rice_contents_extra[best_parameters_index].raw_bits, sizeof(unsigned)*(1<<(best_partition_order))); /* - * Now need to check if the type should be changed to - * FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 based on the - * size of the rice parameters. - */ + * Now need to check if the type should be changed to + * FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 based on the + * size of the rice parameters. + */ for(partition = 0; partition < (1u<<best_partition_order); partition++) { if(prc->parameters[partition] >= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER) { best_ecm->type = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2; @@ -3932,11 +3932,11 @@ static FLaC__INLINE unsigned count_rice_bits_in_partition_( ) - (partition_samples >> 1) /* -(partition_samples>>1) to subtract out extra contributions to the abs_residual_partition_sum. - * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1) - * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out. - * So the subtraction term tries to guess how many extra bits were contributed. - * If the LSBs are randomly distributed, this should average to 0.5 extra bits per sample. - */ + * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1) + * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out. + * So the subtraction term tries to guess how many extra bits were contributed. + * If the LSBs are randomly distributed, this should average to 0.5 extra bits per sample. + */ ; } #endif @@ -4038,13 +4038,13 @@ FLAC__bool set_partitioned_rice_( } mean = abs_residual_partition_sums[partition]; /* we are basically calculating the size in bits of the - * average residual magnitude in the partition: - * rice_parameter = floor(log2(mean/partition_samples)) - * 'mean' is not a good name for the variable, it is - * actually the sum of magnitudes of all residual values - * in the partition, so the actual mean is - * mean/partition_samples - */ + * average residual magnitude in the partition: + * rice_parameter = floor(log2(mean/partition_samples)) + * 'mean' is not a good name for the variable, it is + * actually the sum of magnitudes of all residual values + * in the partition, so the actual mean is + * mean/partition_samples + */ for(rice_parameter = 0, k = partition_samples; k < mean; rice_parameter++, k <<= 1) ; if(rice_parameter >= rice_parameter_limit) { @@ -4174,9 +4174,9 @@ FLAC__StreamDecoderReadStatus verify_read_callback_(const FLAC__StreamDecoder *d else { if(encoded_bytes == 0) { /* - * If we get here, a FIFO underflow has occurred, - * which means there is a bug somewhere. - */ + * If we get here, a FIFO underflow has occurred, + * which means there is a bug somewhere. + */ FLAC__ASSERT(0); return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } @@ -4306,21 +4306,21 @@ FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *e FLAC__bool call_it = 0 != encoder->private_->progress_callback && ( #if FLAC__HAS_OGG /* We would like to be able to use 'samples > 0' in the - * clause here but currently because of the nature of our - * Ogg writing implementation, 'samples' is always 0 (see - * ogg_encoder_aspect.c). The downside is extra progress - * callbacks. - */ + * clause here but currently because of the nature of our + * Ogg writing implementation, 'samples' is always 0 (see + * ogg_encoder_aspect.c). The downside is extra progress + * callbacks. + */ encoder->private_->is_ogg? true : #endif samples > 0 ); if(call_it) { /* NOTE: We have to add +bytes, +samples, and +1 to the stats - * because at this point in the callback chain, the stats - * have not been updated. Only after we return and control - * gets back to write_frame_() are the stats updated - */ + * because at this point in the callback chain, the stats + * have not been updated. Only after we return and control + * gets back to write_frame_() are the stats updated + */ encoder->private_->progress_callback(encoder, encoder->private_->bytes_written+bytes, encoder->private_->samples_written+samples, encoder->private_->frames_written+(samples?1:0), encoder->private_->total_frames_estimate, encoder->private_->client_data); } return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; @@ -4336,9 +4336,9 @@ FILE *get_binary_stdout_(void) { #if 0 /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ + * absence of an underscore before the identifiers 'setmode', + * 'fileno', and/or 'O_BINARY'; check your system header files. + */ #if defined _MSC_VER || defined __MINGW32__ _setmode(_fileno(stdout), _O_BINARY); #elif defined __CYGWIN__ diff --git a/src/lib/libflac/libflac/stream_encoder_framing.c b/src/lib/libflac/libflac/stream_encoder_framing.c index 664b963bb62..eefb7cb6f3c 100644 --- a/src/lib/libflac/libflac/stream_encoder_framing.c +++ b/src/lib/libflac/libflac/stream_encoder_framing.c @@ -59,8 +59,8 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__ return false; /* - * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string - */ + * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string + */ i = metadata->length; if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { FLAC__ASSERT(metadata->data.vorbis_comment.vendor_string.length == 0 || 0 != metadata->data.vorbis_comment.vendor_string.entry); diff --git a/src/lib/libjpeg/jcapimin.c b/src/lib/libjpeg/jcapimin.c index 639ce86f44f..8ae33d837ba 100644 --- a/src/lib/libjpeg/jcapimin.c +++ b/src/lib/libjpeg/jcapimin.c @@ -37,7 +37,7 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) if (version != JPEG_LIB_VERSION) ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); if (structsize != SIZEOF(struct jpeg_compress_struct)) - ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); /* For debugging purposes, we zero the whole master structure. @@ -244,14 +244,14 @@ jpeg_write_m_byte (j_compress_ptr cinfo, int val) * To produce a pair of files containing abbreviated tables and abbreviated * image data, one would proceed as follows: * - * initialize JPEG object - * set JPEG parameters - * set destination to table file - * jpeg_write_tables(cinfo); - * set destination to image file - * jpeg_start_compress(cinfo, FALSE); - * write data... - * jpeg_finish_compress(cinfo); + * initialize JPEG object + * set JPEG parameters + * set destination to table file + * jpeg_write_tables(cinfo); + * set destination to image file + * jpeg_start_compress(cinfo, FALSE); + * write data... + * jpeg_finish_compress(cinfo); * * jpeg_write_tables has the side effect of marking all tables written * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress diff --git a/src/lib/libjpeg/jcarith.c b/src/lib/libjpeg/jcarith.c index 0b7ea55d404..e26905af240 100644 --- a/src/lib/libjpeg/jcarith.c +++ b/src/lib/libjpeg/jcarith.c @@ -216,7 +216,7 @@ finish_pass (j_compress_ptr cinfo) */ LOCAL(void) -arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) +arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) { register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; register unsigned char nl, nm; @@ -278,8 +278,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */ e->sc = 0; /* Note: The 3 spacer bits in the C register guarantee - * that the new buffer byte can't be 0xFF here - * (see page 160 in the P&M JPEG book). */ + * that the new buffer byte can't be 0xFF here + * (see page 160 in the P&M JPEG book). */ e->buffer = temp & 0xFF; /* new output byte, might overflow later */ } else if (temp == 0xFF) { ++e->sc; /* stack 0xFF byte (which might overflow later) */ diff --git a/src/lib/libjpeg/jccolor.c b/src/lib/libjpeg/jccolor.c index 0a8a4b5d13c..787454e2c25 100644 --- a/src/lib/libjpeg/jccolor.c +++ b/src/lib/libjpeg/jccolor.c @@ -31,9 +31,9 @@ typedef my_color_converter * my_cconvert_ptr; * YCbCr is defined per CCIR 601-1, except that Cb and Cr are * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. * The conversion equations to be implemented are therefore - * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B - * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE - * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and diff --git a/src/lib/libjpeg/jcdctmgr.c b/src/lib/libjpeg/jcdctmgr.c index 0bbdbb685d1..83bea7f5f2d 100644 --- a/src/lib/libjpeg/jcdctmgr.c +++ b/src/lib/libjpeg/jcdctmgr.c @@ -90,17 +90,17 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, qval = divisors[i]; temp = workspace[i]; /* Divide the coefficient value by qval, ensuring proper rounding. - * Since C does not specify the direction of rounding for negative - * quotients, we have to force the dividend positive for portability. - * - * In most files, at least half of the output values will be zero - * (at default quantization settings, more like three-quarters...) - * so we should ensure that this case is fast. On many machines, - * a comparison is enough cheaper than a divide to make a special test - * a win. Since both inputs will be nonnegative, we need only test - * for a < b to discover whether a/b is 0. - * If your machine's division is fast enough, define FAST_DIVIDE. - */ + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * + * In most files, at least half of the output values will be zero + * (at default quantization settings, more like three-quarters...) + * so we should ensure that this case is fast. On many machines, + * a comparison is enough cheaper than a divide to make a special test + * a win. Since both inputs will be nonnegative, we need only test + * for a < b to discover whether a/b is 0. + * If your machine's division is fast enough, define FAST_DIVIDE. + */ #ifdef FAST_DIVIDE #define DIVIDE_BY(a,b) a /= b #else @@ -153,11 +153,11 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, /* Apply the quantization and scaling factor */ temp = workspace[i] * divisors[i]; /* Round to nearest integer. - * Since C does not specify the direction of rounding for negative - * quotients, we have to force the dividend positive for portability. - * The maximum coefficient size is +-16K (for 12-bit data), so this - * code should work for either 16-bit or 32-bit ints. - */ + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * The maximum coefficient size is +-16K (for 12-bit data), so this + * code should work for either 16-bit or 32-bit ints. + */ output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); } } @@ -376,11 +376,11 @@ start_pass_fdctmgr (j_compress_ptr cinfo) case JDCT_IFAST: { /* For AA&N IDCT method, divisors are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 8. - */ + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + */ #define CONST_BITS 14 static const INT16 aanscales[DCTSIZE2] = { /* precomputed values scaled up by 14 bits */ @@ -415,13 +415,13 @@ start_pass_fdctmgr (j_compress_ptr cinfo) case JDCT_FLOAT: { /* For float AA&N IDCT method, divisors are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 8. - * What's actually stored is 1/divisor so that the inner loop can - * use a multiplication rather than a division. - */ + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + * What's actually stored is 1/divisor so that the inner loop can + * use a multiplication rather than a division. + */ FAST_FLOAT * fdtbl; int row, col; static const double aanscalefactor[DCTSIZE] = { diff --git a/src/lib/libjpeg/jchuff.c b/src/lib/libjpeg/jchuff.c index abf27d05e8a..d226a5093cf 100644 --- a/src/lib/libjpeg/jchuff.c +++ b/src/lib/libjpeg/jchuff.c @@ -186,7 +186,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(c_derived_tbl)); dtbl = *pdtbl; - + /* Figure C.1: make table of Huffman code length for each symbol */ p = 0; @@ -199,7 +199,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, } huffsize[p] = 0; lastp = p; - + /* Figure C.2: generate the codes themselves */ /* We also validate that the counts represent a legal Huffman code tree. */ @@ -219,7 +219,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, code <<= 1; si++; } - + /* Figure C.3: generate encoding tables */ /* These are code and size indexed by symbol value */ @@ -316,16 +316,16 @@ emit_bits_s (working_state * state, unsigned int code, int size) ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */ - + put_bits += size; /* new number of bits in buffer */ - + put_buffer <<= 24 - put_bits; /* align incoming bits */ put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */ - + while (put_bits >= 8) { int c = (int) ((put_buffer >> 16) & 0xFF); - + emit_byte_s(state, c, return FALSE); if (c == 0xFF) { /* need to stuff a zero byte? */ emit_byte_s(state, 0, return FALSE); @@ -358,7 +358,7 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size) return; /* do nothing if we're only getting stats */ put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */ - + put_bits += size; /* new number of bits in buffer */ put_buffer <<= 24 - put_bits; /* align incoming bits */ @@ -580,7 +580,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* This code assumes we are on a two's complement machine */ temp2--; } - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; while (temp) { @@ -592,10 +592,10 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) */ if (nbits > MAX_COEF_BITS+1) ERREXIT(cinfo, JERR_BAD_DCT_COEF); - + /* Count/emit the Huffman-coded symbol for the number of bits */ emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits); - + /* Emit that number of bits of the value, if positive, */ /* or the complement of its magnitude, if negative. */ if (nbits) /* emit_bits rejects calls with size 0 */ @@ -651,9 +651,9 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) block = MCU_data[0]; /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ - + r = 0; /* r = run length of zeros */ - + for (k = cinfo->Ss; k <= Se; k++) { if ((temp = (*block)[natural_order[k]]) == 0) { r++; @@ -830,7 +830,7 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) } /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ - + r = 0; /* r = run length of zeros */ BR = 0; /* BR = count of buffered bits added now */ BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ @@ -1127,13 +1127,13 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, register int k, r; int Se = cinfo->lim_Se; const int * natural_order = cinfo->natural_order; - + /* Encode the DC coefficient difference per section F.1.2.1 */ - + temp = block[0] - last_dc_val; if (temp < 0) temp = -temp; - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; while (temp) { @@ -1148,11 +1148,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Count the Huffman symbol for the number of bits */ dc_counts[nbits]++; - + /* Encode the AC coefficients per section F.1.2.2 */ - + r = 0; /* r = run length of zeros */ - + for (k = 1; k <= Se; k++) { if ((temp = block[natural_order[k]]) == 0) { r++; @@ -1162,11 +1162,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, ac_counts[0xF0]++; r -= 16; } - + /* Find the number of bits needed for the magnitude of the coefficient */ if (temp < 0) temp = -temp; - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 1; /* there must be at least one 1 bit */ while ((temp >>= 1)) @@ -1174,10 +1174,10 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Check for out-of-range coefficient values */ if (nbits > MAX_COEF_BITS) ERREXIT(cinfo, JERR_BAD_DCT_COEF); - + /* Count Huffman symbol for run length / number of bits */ ac_counts[(r << 4) + nbits]++; - + r = 0; } } @@ -1269,7 +1269,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) MEMZERO(codesize, SIZEOF(codesize)); for (i = 0; i < 257; i++) others[i] = -1; /* init links to empty */ - + freq[256] = 1; /* make sure 256 has a nonzero count */ /* Including the pseudo-symbol 256 in the Huffman procedure guarantees * that no real symbol is given code-value of all ones, because 256 @@ -1304,7 +1304,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) /* Done if we've merged everything into one frequency */ if (c2 < 0) break; - + /* Else merge the two counts/trees */ freq[c1] += freq[c2]; freq[c2] = 0; @@ -1315,9 +1315,9 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) c1 = others[c1]; codesize[c1]++; } - + others[c1] = c2; /* chain c2 onto c1's tree branch */ - + /* Increment the codesize of everything in c2's tree branch */ codesize[c2]++; while (others[c2] >= 0) { @@ -1348,13 +1348,13 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) * shortest nonzero BITS entry is converted into a prefix for two code words * one bit longer. */ - + for (i = MAX_CLEN; i > 16; i--) { while (bits[i] > 0) { j = i - 2; /* find length of new prefix to be used */ while (bits[j] == 0) j--; - + bits[i] -= 2; /* remove two symbols */ bits[i-1]++; /* one goes in this length */ bits[j+1] += 2; /* two new symbols in this length */ @@ -1366,10 +1366,10 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) while (bits[i] == 0) /* find largest codelength still in use */ i--; bits[i]--; - + /* Return final symbol counts (only for lengths 0..16) */ MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); - + /* Return a list of the symbols sorted by code length */ /* It's not real clear to me why we don't need to consider the codelength * changes made above, but the JPEG spec seems to think this works. diff --git a/src/lib/libjpeg/jcmainct.c b/src/lib/libjpeg/jcmainct.c index 6c8ffdf11fe..b0368223700 100644 --- a/src/lib/libjpeg/jcmainct.c +++ b/src/lib/libjpeg/jcmainct.c @@ -208,11 +208,11 @@ process_data_buffer_main (j_compress_ptr cinfo, if (main->pass_mode != JBUF_SAVE_SOURCE) { if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) { /* If compressor did not consume the whole row, then we must need to - * suspend processing and return to the application. In this situation - * we pretend we didn't yet consume the last input row; otherwise, if - * it happened to be the last row of the image, the application would - * think we were done. - */ + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ if (! main->suspended) { (*in_row_ctr)--; main->suspended = TRUE; diff --git a/src/lib/libjpeg/jcmarker.c b/src/lib/libjpeg/jcmarker.c index 606c19af397..af5442abf63 100644 --- a/src/lib/libjpeg/jcmarker.c +++ b/src/lib/libjpeg/jcmarker.c @@ -19,24 +19,24 @@ typedef enum { /* JPEG marker codes */ M_SOF1 = 0xc1, M_SOF2 = 0xc2, M_SOF3 = 0xc3, - + M_SOF5 = 0xc5, M_SOF6 = 0xc6, M_SOF7 = 0xc7, - + M_JPG = 0xc8, M_SOF9 = 0xc9, M_SOF10 = 0xca, M_SOF11 = 0xcb, - + M_SOF13 = 0xcd, M_SOF14 = 0xce, M_SOF15 = 0xcf, - + M_DHT = 0xc4, - + M_DAC = 0xcc, - + M_RST0 = 0xd0, M_RST1 = 0xd1, M_RST2 = 0xd2, @@ -45,7 +45,7 @@ typedef enum { /* JPEG marker codes */ M_RST5 = 0xd5, M_RST6 = 0xd6, M_RST7 = 0xd7, - + M_SOI = 0xd8, M_EOI = 0xd9, M_SOS = 0xda, @@ -54,7 +54,7 @@ typedef enum { /* JPEG marker codes */ M_DRI = 0xdd, M_DHP = 0xde, M_EXP = 0xdf, - + M_APP0 = 0xe0, M_APP1 = 0xe1, M_APP2 = 0xe2, @@ -71,13 +71,13 @@ typedef enum { /* JPEG marker codes */ M_APP13 = 0xed, M_APP14 = 0xee, M_APP15 = 0xef, - + M_JPG0 = 0xf0, M_JPG13 = 0xfd, M_COM = 0xfe, - + M_TEM = 0x01, - + M_ERROR = 0x100 } JPEG_MARKER; @@ -188,7 +188,7 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) { JHUFF_TBL * htbl; int length, i; - + if (is_ac) { htbl = cinfo->ac_huff_tbl_ptrs[index]; index += 0x10; /* output index has AC bit set */ @@ -198,23 +198,23 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) if (htbl == NULL) ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index); - + if (! htbl->sent_table) { emit_marker(cinfo, M_DHT); - + length = 0; for (i = 1; i <= 16; i++) length += htbl->bits[i]; - + emit_2bytes(cinfo, length + 2 + 1 + 16); emit_byte(cinfo, index); - + for (i = 1; i <= 16; i++) emit_byte(cinfo, htbl->bits[i]); - + for (i = 0; i < length; i++) emit_byte(cinfo, htbl->huffval[i]); - + htbl->sent_table = TRUE; } } @@ -274,7 +274,7 @@ emit_dri (j_compress_ptr cinfo) /* Emit a DRI marker */ { emit_marker(cinfo, M_DRI); - + emit_2bytes(cinfo, 4); /* fixed length */ emit_2bytes(cinfo, (int) cinfo->restart_interval); @@ -287,9 +287,9 @@ emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) { int ci; jpeg_component_info *compptr; - + emit_marker(cinfo, code); - + emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ /* Make sure image isn't bigger than SOF field can handle */ @@ -318,13 +318,13 @@ emit_sos (j_compress_ptr cinfo) { int i, td, ta; jpeg_component_info *compptr; - + emit_marker(cinfo, M_SOS); - + emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ - + emit_byte(cinfo, cinfo->comps_in_scan); - + for (i = 0; i < cinfo->comps_in_scan; i++) { compptr = cinfo->cur_comp_info[i]; emit_byte(cinfo, compptr->component_id); @@ -352,9 +352,9 @@ emit_pseudo_sos (j_compress_ptr cinfo) /* Emit a pseudo SOS marker */ { emit_marker(cinfo, M_SOS); - + emit_2bytes(cinfo, 2 + 1 + 3); /* length */ - + emit_byte(cinfo, 0); /* Ns */ emit_byte(cinfo, 0); /* Ss */ @@ -368,19 +368,19 @@ emit_jfif_app0 (j_compress_ptr cinfo) /* Emit a JFIF-compliant APP0 marker */ { /* - * Length of APP0 block (2 bytes) - * Block ID (4 bytes - ASCII "JFIF") - * Zero byte (1 byte to terminate the ID string) - * Version Major, Minor (2 bytes - major first) - * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) - * Xdpu (2 bytes - dots per unit horizontal) - * Ydpu (2 bytes - dots per unit vertical) - * Thumbnail X size (1 byte) - * Thumbnail Y size (1 byte) + * Length of APP0 block (2 bytes) + * Block ID (4 bytes - ASCII "JFIF") + * Zero byte (1 byte to terminate the ID string) + * Version Major, Minor (2 bytes - major first) + * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) + * Xdpu (2 bytes - dots per unit horizontal) + * Ydpu (2 bytes - dots per unit vertical) + * Thumbnail X size (1 byte) + * Thumbnail Y size (1 byte) */ - + emit_marker(cinfo, M_APP0); - + emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ @@ -403,12 +403,12 @@ emit_adobe_app14 (j_compress_ptr cinfo) /* Emit an Adobe APP14 marker */ { /* - * Length of APP14 block (2 bytes) - * Block ID (5 bytes - ASCII "Adobe") - * Version Number (2 bytes - currently 100) - * Flags0 (2 bytes - currently 0) - * Flags1 (2 bytes - currently 0) - * Color transform (1 byte) + * Length of APP14 block (2 bytes) + * Block ID (5 bytes - ASCII "Adobe") + * Version Number (2 bytes - currently 100) + * Flags0 (2 bytes - currently 0) + * Flags1 (2 bytes - currently 0) + * Color transform (1 byte) * * Although Adobe TN 5116 mentions Version = 101, all the Adobe files * now in circulation seem to use Version = 100, so that's what we write. @@ -417,9 +417,9 @@ emit_adobe_app14 (j_compress_ptr cinfo) * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with * whether the encoder performed a transformation, which is pretty useless. */ - + emit_marker(cinfo, M_APP14); - + emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ @@ -514,7 +514,7 @@ write_frame_header (j_compress_ptr cinfo) int ci, prec; boolean is_baseline; jpeg_component_info *compptr; - + /* Emit DQT for each quantization table. * Note that emit_dqt() suppresses any duplicate tables. */ diff --git a/src/lib/libjpeg/jcmaster.c b/src/lib/libjpeg/jcmaster.c index caf80a53b38..2929f6b5d44 100644 --- a/src/lib/libjpeg/jcmaster.c +++ b/src/lib/libjpeg/jcmaster.c @@ -8,7 +8,7 @@ * * This file contains master control logic for the JPEG compressor. * These routines are concerned with parameter validation, initial setup, - * and inter-pass control (determining the number of passes and the work + * and inter-pass control (determining the number of passes and the work * to be done in each pass). */ @@ -381,7 +381,7 @@ validate_script (j_compress_ptr cinfo) #ifdef C_PROGRESSIVE_SUPPORTED cinfo->progressive_mode = TRUE; last_bitpos_ptr = & last_bitpos[0][0]; - for (ci = 0; ci < cinfo->num_components; ci++) + for (ci = 0; ci < cinfo->num_components; ci++) for (coefi = 0; coefi < DCTSIZE2; coefi++) *last_bitpos_ptr++ = -1; #else @@ -389,7 +389,7 @@ validate_script (j_compress_ptr cinfo) #endif } else { cinfo->progressive_mode = FALSE; - for (ci = 0; ci < cinfo->num_components; ci++) + for (ci = 0; ci < cinfo->num_components; ci++) component_sent[ci] = FALSE; } @@ -575,16 +575,16 @@ per_scan_setup (j_compress_ptr cinfo) { int ci, mcublks, tmp; jpeg_component_info *compptr; - + if (cinfo->comps_in_scan == 1) { - + /* Noninterleaved (single-component) scan */ compptr = cinfo->cur_comp_info[0]; - + /* Overall image size in MCUs */ cinfo->MCUs_per_row = compptr->width_in_blocks; cinfo->MCU_rows_in_scan = compptr->height_in_blocks; - + /* For noninterleaved scan, always one block per MCU */ compptr->MCU_width = 1; compptr->MCU_height = 1; @@ -597,18 +597,18 @@ per_scan_setup (j_compress_ptr cinfo) tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (tmp == 0) tmp = compptr->v_samp_factor; compptr->last_row_height = tmp; - + /* Prepare array describing MCU composition */ cinfo->blocks_in_MCU = 1; cinfo->MCU_membership[0] = 0; - + } else { - + /* Interleaved (multi-component) scan */ if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, MAX_COMPS_IN_SCAN); - + /* Overall image size in MCUs */ cinfo->MCUs_per_row = (JDIMENSION) jdiv_round_up((long) cinfo->jpeg_width, @@ -616,9 +616,9 @@ per_scan_setup (j_compress_ptr cinfo) cinfo->MCU_rows_in_scan = (JDIMENSION) jdiv_round_up((long) cinfo->jpeg_height, (long) (cinfo->max_v_samp_factor * cinfo->block_size)); - + cinfo->blocks_in_MCU = 0; - + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; /* Sampling factors give # of blocks of component in each MCU */ @@ -641,7 +641,7 @@ per_scan_setup (j_compress_ptr cinfo) cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; } } - + } /* Convert restart specified in rows to actual MCU count. */ diff --git a/src/lib/libjpeg/jcparam.c b/src/lib/libjpeg/jcparam.c index c5e85dda550..e974fec994f 100644 --- a/src/lib/libjpeg/jcparam.c +++ b/src/lib/libjpeg/jcparam.c @@ -204,12 +204,12 @@ std_huff_tables (j_compress_ptr cinfo) { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; static const UINT8 val_dc_luminance[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - + static const UINT8 bits_dc_chrominance[17] = { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; static const UINT8 val_dc_chrominance[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - + static const UINT8 bits_ac_luminance[17] = { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; static const UINT8 val_ac_luminance[] = @@ -234,7 +234,7 @@ std_huff_tables (j_compress_ptr cinfo) 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }; - + static const UINT8 bits_ac_chrominance[17] = { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; static const UINT8 val_ac_chrominance[] = @@ -259,7 +259,7 @@ std_huff_tables (j_compress_ptr cinfo) 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }; - + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], bits_dc_luminance, val_dc_luminance); add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], diff --git a/src/lib/libjpeg/jctrans.c b/src/lib/libjpeg/jctrans.c index cee6b0f343f..dea0c3699a1 100644 --- a/src/lib/libjpeg/jctrans.c +++ b/src/lib/libjpeg/jctrans.c @@ -315,11 +315,11 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) xindex = 0; } /* Fill in any dummy blocks needed in this row. - * Dummy blocks are filled in the same way as in jccoefct.c: - * all zeroes in the AC entries, DC entries equal to previous - * block's DC value. The init routine has already zeroed the - * AC entries, so we need only set the DC entries correctly. - */ + * Dummy blocks are filled in the same way as in jccoefct.c: + * all zeroes in the AC entries, DC entries equal to previous + * block's DC value. The init routine has already zeroed the + * AC entries, so we need only set the DC entries correctly. + */ for (; xindex < compptr->MCU_width; xindex++) { MCU_buffer[blkn] = coef->dummy_buffer[blkn]; MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; diff --git a/src/lib/libjpeg/jdapimin.c b/src/lib/libjpeg/jdapimin.c index 7f1ce4c05b2..8b4032b7f07 100644 --- a/src/lib/libjpeg/jdapimin.c +++ b/src/lib/libjpeg/jdapimin.c @@ -37,7 +37,7 @@ jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) if (version != JPEG_LIB_VERSION) ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); if (structsize != SIZEOF(struct jpeg_decompress_struct)) - ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); /* For debugging purposes, we zero the whole master structure. @@ -122,7 +122,7 @@ default_decompress_parms (j_decompress_ptr cinfo) cinfo->jpeg_color_space = JCS_GRAYSCALE; cinfo->out_color_space = JCS_GRAYSCALE; break; - + case 3: if (cinfo->saw_JFIF_marker) { cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ @@ -157,7 +157,7 @@ default_decompress_parms (j_decompress_ptr cinfo) /* Always guess RGB is proper output colorspace. */ cinfo->out_color_space = JCS_RGB; break; - + case 4: if (cinfo->saw_Adobe_marker) { switch (cinfo->Adobe_transform) { @@ -178,7 +178,7 @@ default_decompress_parms (j_decompress_ptr cinfo) } cinfo->out_color_space = JCS_CMYK; break; - + default: cinfo->jpeg_color_space = JCS_UNKNOWN; cinfo->out_color_space = JCS_UNKNOWN; diff --git a/src/lib/libjpeg/jdarith.c b/src/lib/libjpeg/jdarith.c index c858b248b6b..d5c04953195 100644 --- a/src/lib/libjpeg/jdarith.c +++ b/src/lib/libjpeg/jdarith.c @@ -125,11 +125,11 @@ arith_decode (j_decompress_ptr cinfo, unsigned char *st) data = 0xFF; /* discard stuffed zero byte */ else { /* Note: Different from the Huffman decoder, hitting - * a marker while processing the compressed data - * segment is legal in arithmetic coding. - * The convention is to supply zero data - * then until decoding is complete. - */ + * a marker while processing the compressed data + * segment is legal in arithmetic coding. + * The convention is to supply zero data + * then until decoding is complete. + */ cinfo->unread_marker = data; data = 0; } @@ -765,7 +765,7 @@ jinit_arith_decoder (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->num_components*DCTSIZE2*SIZEOF(int)); coef_bit_ptr = & cinfo->coef_bits[0][0]; - for (ci = 0; ci < cinfo->num_components; ci++) + for (ci = 0; ci < cinfo->num_components; ci++) for (i = 0; i < DCTSIZE2; i++) *coef_bit_ptr++ = -1; } diff --git a/src/lib/libjpeg/jdcoefct.c b/src/lib/libjpeg/jdcoefct.c index 462e92c6125..1f0f442ab47 100644 --- a/src/lib/libjpeg/jdcoefct.c +++ b/src/lib/libjpeg/jdcoefct.c @@ -568,9 +568,9 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) DC9 = (int) next_block_row[1][0]; } /* Compute coefficient estimates per K.8. - * An estimate is applied only if coefficient is still zero, - * and is not known to be fully accurate. - */ + * An estimate is applied only if coefficient is still zero, + * and is not known to be fully accurate. + */ /* AC01 */ if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { num = 36 * Q00 * (DC4 - DC6); diff --git a/src/lib/libjpeg/jdcolor.c b/src/lib/libjpeg/jdcolor.c index 6c04dfe8aa1..66c219529e3 100644 --- a/src/lib/libjpeg/jdcolor.c +++ b/src/lib/libjpeg/jdcolor.c @@ -34,9 +34,9 @@ typedef my_color_deconverter * my_cconvert_ptr; * YCbCr is defined per CCIR 601-1, except that Cb and Cr are * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. * The conversion equations to be implemented are therefore - * R = Y + 1.40200 * Cr - * G = Y - 0.34414 * Cb - 0.71414 * Cr - * B = Y + 1.77200 * Cb + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb * where Cb and Cr represent the incoming values less CENTERJSAMPLE. * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) * diff --git a/src/lib/libjpeg/jdct.h b/src/lib/libjpeg/jdct.h index 360dec80c94..832c2cfee38 100644 --- a/src/lib/libjpeg/jdct.h +++ b/src/lib/libjpeg/jdct.h @@ -8,7 +8,7 @@ * This include file contains common declarations for the forward and * inverse DCT modules. These declarations are private to the DCT managers * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. - * The individual DCT algorithms are kept in separate files to ease + * The individual DCT algorithms are kept in separate files to ease * machine-dependent tuning (e.g., assembly coding). */ diff --git a/src/lib/libjpeg/jddctmgr.c b/src/lib/libjpeg/jddctmgr.c index 0ded9d57413..ecc21beb863 100644 --- a/src/lib/libjpeg/jddctmgr.c +++ b/src/lib/libjpeg/jddctmgr.c @@ -275,8 +275,8 @@ start_pass (j_decompress_ptr cinfo) case JDCT_ISLOW: { /* For LL&M IDCT method, multipliers are equal to raw quantization - * coefficients, but are stored as ints to ensure access efficiency. - */ + * coefficients, but are stored as ints to ensure access efficiency. + */ ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; for (i = 0; i < DCTSIZE2; i++) { ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; @@ -288,12 +288,12 @@ start_pass (j_decompress_ptr cinfo) case JDCT_IFAST: { /* For AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * For integer operation, the multiplier table is to be scaled by - * IFAST_SCALE_BITS. - */ + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * For integer operation, the multiplier table is to be scaled by + * IFAST_SCALE_BITS. + */ IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; #define CONST_BITS 14 static const INT16 aanscales[DCTSIZE2] = { @@ -322,11 +322,11 @@ start_pass (j_decompress_ptr cinfo) case JDCT_FLOAT: { /* For float AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 1/8. - */ + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 1/8. + */ FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; int row, col; static const double aanscalefactor[DCTSIZE] = { diff --git a/src/lib/libjpeg/jdhuff.c b/src/lib/libjpeg/jdhuff.c index 06f92fe47f6..8f0581fa172 100644 --- a/src/lib/libjpeg/jdhuff.c +++ b/src/lib/libjpeg/jdhuff.c @@ -120,14 +120,14 @@ typedef struct { /* Bitreading working state within an MCU */ * before using GET_BITS, PEEK_BITS, or DROP_BITS. * The variables get_buffer and bits_left are assumed to be locals, * but the state struct might not be (jpeg_huff_decode needs this). - * CHECK_BIT_BUFFER(state,n,action); - * Ensure there are N bits in get_buffer; if suspend, take action. + * CHECK_BIT_BUFFER(state,n,action); + * Ensure there are N bits in get_buffer; if suspend, take action. * val = GET_BITS(n); - * Fetch next N bits. + * Fetch next N bits. * val = PEEK_BITS(n); - * Fetch next N bits without removing them from the buffer. - * DROP_BITS(n); - * Discard next N bits. + * Fetch next N bits without removing them from the buffer. + * DROP_BITS(n); + * Discard next N bits. * The value N should be a simple variable, not an expression, because it * is evaluated multiple times. */ @@ -350,7 +350,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, SIZEOF(d_derived_tbl)); dtbl = *pdtbl; dtbl->pub = htbl; /* fill in back link */ - + /* Figure C.1: make table of Huffman code length for each symbol */ p = 0; @@ -363,10 +363,10 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, } huffsize[p] = 0; numsymbols = p; - + /* Figure C.2: generate the codes themselves */ /* We also validate that the counts represent a legal Huffman code tree. */ - + code = 0; si = huffsize[0]; p = 0; @@ -493,10 +493,10 @@ jpeg_fill_bit_buffer (bitread_working_state * state, /* If it's 0xFF, check and discard stuffed zero byte */ if (c == 0xFF) { /* Loop here to discard any padding FF's on terminating marker, - * so that we can save a valid unread_marker value. NOTE: we will - * accept multiple FF's followed by a 0 as meaning a single FF data - * byte. This data pattern is not valid according to the standard. - */ + * so that we can save a valid unread_marker value. NOTE: we will + * accept multiple FF's followed by a 0 as meaning a single FF data + * byte. This data pattern is not valid according to the standard. + */ do { if (bytes_in_buffer == 0) { if (! (*cinfo->src->fill_input_buffer) (cinfo)) @@ -513,13 +513,13 @@ jpeg_fill_bit_buffer (bitread_working_state * state, c = 0xFF; } else { /* Oops, it's actually a marker indicating end of compressed data. - * Save the marker code for later use. - * Fine point: it might appear that we should save the marker into - * bitread working state, not straight into permanent state. But - * once we have hit a marker, we cannot need to suspend within the - * current MCU, because we will read no more bytes from the data - * source. So it is OK to update permanent state right away. - */ + * Save the marker code for later use. + * Fine point: it might appear that we should save the marker into + * bitread working state, not straight into permanent state. But + * once we have hit a marker, we cannot need to suspend within the + * current MCU, because we will read no more bytes from the data + * source. So it is OK to update permanent state right away. + */ cinfo->unread_marker = c; /* See if we need to insert some fake zero bits. */ goto no_more_bytes; @@ -671,7 +671,7 @@ process_restart (j_decompress_ptr cinfo) /* * Huffman MCU decoding. * Each of these routines decodes and returns one MCU's worth of - * Huffman-compressed coefficients. + * Huffman-compressed coefficients. * The coefficients are reordered from zigzag order into natural array order, * but are not dequantized. * @@ -693,7 +693,7 @@ process_restart (j_decompress_ptr cinfo) METHODDEF(boolean) decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ +{ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int Al = cinfo->Al; register int s, r; @@ -764,7 +764,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) METHODDEF(boolean) decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ +{ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; register int s, k, r; unsigned int EOBRUN; @@ -853,7 +853,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) METHODDEF(boolean) decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ +{ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ int blkn; @@ -902,7 +902,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) METHODDEF(boolean) decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ +{ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; register int s, k, r; unsigned int EOBRUN; @@ -976,9 +976,9 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* note s = 0 for processing ZRL */ } /* Advance over already-nonzero coefs and r still-zero coefs, - * appending correction bits to the nonzeroes. A correction bit is 1 - * if the absolute value of the coefficient must be increased. - */ + * appending correction bits to the nonzeroes. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ do { thiscoef = *block + natural_order[k]; if (*thiscoef != 0) { @@ -1127,9 +1127,9 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) r = GET_BITS(s); s = HUFF_EXTEND(r, s); /* Output coefficient in natural (dezigzagged) order. - * Note: the extra entries in natural_order[] will save us - * if k > Se, which could happen if the data is corrupted. - */ + * Note: the extra entries in natural_order[] will save us + * if k > Se, which could happen if the data is corrupted. + */ (*block)[natural_order[k]] = (JCOEF) s; } else { if (r != 15) @@ -1251,9 +1251,9 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) r = GET_BITS(s); s = HUFF_EXTEND(r, s); /* Output coefficient in natural (dezigzagged) order. - * Note: the extra entries in jpeg_natural_order[] will save us - * if k >= DCTSIZE2, which could happen if the data is corrupted. - */ + * Note: the extra entries in jpeg_natural_order[] will save us + * if k >= DCTSIZE2, which could happen if the data is corrupted. + */ (*block)[jpeg_natural_order[k]] = (JCOEF) s; } else { if (r != 15) diff --git a/src/lib/libjpeg/jdinput.c b/src/lib/libjpeg/jdinput.c index 2c5c717b9c3..2fcf04fdfc2 100644 --- a/src/lib/libjpeg/jdinput.c +++ b/src/lib/libjpeg/jdinput.c @@ -391,16 +391,16 @@ per_scan_setup (j_decompress_ptr cinfo) { int ci, mcublks, tmp; jpeg_component_info *compptr; - + if (cinfo->comps_in_scan == 1) { - + /* Noninterleaved (single-component) scan */ compptr = cinfo->cur_comp_info[0]; - + /* Overall image size in MCUs */ cinfo->MCUs_per_row = compptr->width_in_blocks; cinfo->MCU_rows_in_scan = compptr->height_in_blocks; - + /* For noninterleaved scan, always one block per MCU */ compptr->MCU_width = 1; compptr->MCU_height = 1; @@ -413,18 +413,18 @@ per_scan_setup (j_decompress_ptr cinfo) tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (tmp == 0) tmp = compptr->v_samp_factor; compptr->last_row_height = tmp; - + /* Prepare array describing MCU composition */ cinfo->blocks_in_MCU = 1; cinfo->MCU_membership[0] = 0; - + } else { - + /* Interleaved (multi-component) scan */ if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, MAX_COMPS_IN_SCAN); - + /* Overall image size in MCUs */ cinfo->MCUs_per_row = (JDIMENSION) jdiv_round_up((long) cinfo->image_width, @@ -432,9 +432,9 @@ per_scan_setup (j_decompress_ptr cinfo) cinfo->MCU_rows_in_scan = (JDIMENSION) jdiv_round_up((long) cinfo->image_height, (long) (cinfo->max_v_samp_factor * cinfo->block_size)); - + cinfo->blocks_in_MCU = 0; - + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; /* Sampling factors give # of blocks of component in each MCU */ @@ -457,7 +457,7 @@ per_scan_setup (j_decompress_ptr cinfo) cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; } } - + } } @@ -578,9 +578,9 @@ consume_markers (j_decompress_ptr cinfo) } inputctl->inheaders = 0; /* Note: start_input_pass must be called by jdmaster.c - * before any more input can be consumed. jdapimin.c is - * responsible for enforcing this sequencing. - */ + * before any more input can be consumed. jdapimin.c is + * responsible for enforcing this sequencing. + */ } else { /* 2nd or later SOS marker */ if (! inputctl->pub.has_multiple_scans) ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ @@ -596,8 +596,8 @@ consume_markers (j_decompress_ptr cinfo) ERREXIT(cinfo, JERR_SOF_NO_SOS); } else { /* Prevent infinite loop in coef ctlr's decompress_data routine - * if user set output_scan_number larger than number of scans. - */ + * if user set output_scan_number larger than number of scans. + */ if (cinfo->output_scan_number > cinfo->input_scan_number) cinfo->output_scan_number = cinfo->input_scan_number; } diff --git a/src/lib/libjpeg/jdmarker.c b/src/lib/libjpeg/jdmarker.c index f2a9cc42951..a9268370fe3 100644 --- a/src/lib/libjpeg/jdmarker.c +++ b/src/lib/libjpeg/jdmarker.c @@ -23,24 +23,24 @@ typedef enum { /* JPEG marker codes */ M_SOF1 = 0xc1, M_SOF2 = 0xc2, M_SOF3 = 0xc3, - + M_SOF5 = 0xc5, M_SOF6 = 0xc6, M_SOF7 = 0xc7, - + M_JPG = 0xc8, M_SOF9 = 0xc9, M_SOF10 = 0xca, M_SOF11 = 0xcb, - + M_SOF13 = 0xcd, M_SOF14 = 0xce, M_SOF15 = 0xcf, - + M_DHT = 0xc4, - + M_DAC = 0xcc, - + M_RST0 = 0xd0, M_RST1 = 0xd1, M_RST2 = 0xd2, @@ -49,7 +49,7 @@ typedef enum { /* JPEG marker codes */ M_RST5 = 0xd5, M_RST6 = 0xd6, M_RST7 = 0xd7, - + M_SOI = 0xd8, M_EOI = 0xd9, M_SOS = 0xda, @@ -58,7 +58,7 @@ typedef enum { /* JPEG marker codes */ M_DRI = 0xdd, M_DHP = 0xde, M_EXP = 0xdf, - + M_APP0 = 0xe0, M_APP1 = 0xe1, M_APP2 = 0xe2, @@ -75,13 +75,13 @@ typedef enum { /* JPEG marker codes */ M_APP13 = 0xed, M_APP14 = 0xee, M_APP15 = 0xef, - + M_JPG0 = 0xf0, M_JPG13 = 0xfd, M_COM = 0xfe, - + M_TEM = 0x01, - + M_ERROR = 0x100 } JPEG_MARKER; @@ -199,7 +199,7 @@ get_soi (j_decompress_ptr cinfo) /* Process an SOI marker */ { int i; - + TRACEMS(cinfo, 1, JTRC_SOI); if (cinfo->marker->saw_SOI) @@ -278,7 +278,7 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog, cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->num_components * SIZEOF(jpeg_component_info)); - + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { compptr->component_index = ci; @@ -330,7 +330,7 @@ get_sos (j_decompress_ptr cinfo) for (i = 0; i < n; i++) { INPUT_BYTE(cinfo, cc, return FALSE); INPUT_BYTE(cinfo, c, return FALSE); - + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { if (cc == compptr->component_id) @@ -344,7 +344,7 @@ get_sos (j_decompress_ptr cinfo) cinfo->cur_comp_info[i] = compptr; compptr->dc_tbl_no = (c >> 4) & 15; compptr->ac_tbl_no = (c ) & 15; - + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, compptr->dc_tbl_no, compptr->ac_tbl_no); } @@ -384,7 +384,7 @@ get_dac (j_decompress_ptr cinfo) INPUT_2BYTES(cinfo, length, return FALSE); length -= 2; - + while (length > 0) { INPUT_BYTE(cinfo, index, return FALSE); INPUT_BYTE(cinfo, val, return FALSE); @@ -433,12 +433,12 @@ get_dht (j_decompress_ptr cinfo) INPUT_2BYTES(cinfo, length, return FALSE); length -= 2; - + while (length > 16) { INPUT_BYTE(cinfo, index, return FALSE); TRACEMS1(cinfo, 1, JTRC_DHT, index); - + bits[0] = 0; count = 0; for (i = 1; i <= 16; i++) { @@ -478,7 +478,7 @@ get_dht (j_decompress_ptr cinfo) if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); } @@ -515,7 +515,7 @@ get_dqt (j_decompress_ptr cinfo) if (n >= NUM_QUANT_TBLS) ERREXIT1(cinfo, JERR_DQT_INDEX, n); - + if (cinfo->quant_tbl_ptrs[n] == NULL) cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); quant_ptr = cinfo->quant_tbl_ptrs[n]; @@ -590,7 +590,7 @@ get_dri (j_decompress_ptr cinfo) INPUT_VARS(cinfo); INPUT_2BYTES(cinfo, length, return FALSE); - + if (length != 4) ERREXIT(cinfo, JERR_BAD_LENGTH); @@ -887,7 +887,7 @@ skip_variable (j_decompress_ptr cinfo) INPUT_2BYTES(cinfo, length, return FALSE); length -= 2; - + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); INPUT_SYNC(cinfo); /* do before skip_input_data */ @@ -1059,32 +1059,32 @@ read_markers (j_decompress_ptr cinfo) return JPEG_SUSPENDED; cinfo->unread_marker = 0; /* processed the marker */ return JPEG_REACHED_SOS; - + case M_EOI: TRACEMS(cinfo, 1, JTRC_EOI); cinfo->unread_marker = 0; /* processed the marker */ return JPEG_REACHED_EOI; - + case M_DAC: if (! get_dac(cinfo)) return JPEG_SUSPENDED; break; - + case M_DHT: if (! get_dht(cinfo)) return JPEG_SUSPENDED; break; - + case M_DQT: if (! get_dqt(cinfo)) return JPEG_SUSPENDED; break; - + case M_DRI: if (! get_dri(cinfo)) return JPEG_SUSPENDED; break; - + case M_APP0: case M_APP1: case M_APP2: @@ -1105,7 +1105,7 @@ read_markers (j_decompress_ptr cinfo) cinfo->unread_marker - (int) M_APP0]) (cinfo)) return JPEG_SUSPENDED; break; - + case M_COM: if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) return JPEG_SUSPENDED; @@ -1239,10 +1239,10 @@ jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) { int marker = cinfo->unread_marker; int action = 1; - + /* Always put up a warning. */ WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); - + /* Outer loop handles repeated decision after scanning forward. */ for (;;) { if (marker < (int) M_SOF0) diff --git a/src/lib/libjpeg/jdmaster.c b/src/lib/libjpeg/jdmaster.c index 8c1146e4fe1..ba667eb65c1 100644 --- a/src/lib/libjpeg/jdmaster.c +++ b/src/lib/libjpeg/jdmaster.c @@ -191,20 +191,20 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo) * processes are inner loops and need to be as fast as possible. On most * machines, particularly CPUs with pipelines or instruction prefetch, * a (subscript-check-less) C table lookup - * x = sample_range_limit[x]; + * x = sample_range_limit[x]; * is faster than explicit tests - * if (x < 0) x = 0; - * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; + * if (x < 0) x = 0; + * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; * These processes all use a common table prepared by the routine below. * * For most steps we can mathematically guarantee that the initial value * of x is within MAXJSAMPLE+1 of the legal range, so a table running from * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial - * limiting step (just after the IDCT), a wildly out-of-range value is + * limiting step (just after the IDCT), a wildly out-of-range value is * possible if the input data is corrupt. To avoid any chance of indexing * off the end of memory and getting a bad-pointer trap, we perform the * post-IDCT limiting thus: - * x = range_limit[x & MASK]; + * x = range_limit[x & MASK]; * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit * samples. Under normal circumstances this is more than enough range and * a correct output will be generated; with bogus input data the mask will diff --git a/src/lib/libjpeg/jdmerge.c b/src/lib/libjpeg/jdmerge.c index 37444468c23..c421f45e972 100644 --- a/src/lib/libjpeg/jdmerge.c +++ b/src/lib/libjpeg/jdmerge.c @@ -14,19 +14,19 @@ * (ie, box filtering), we can save some work in color conversion by * calculating all the output pixels corresponding to a pair of chroma * samples at one time. In the conversion equations - * R = Y + K1 * Cr - * G = Y + K2 * Cb + K3 * Cr - * B = Y + K4 * Cb + * R = Y + K1 * Cr + * G = Y + K2 * Cb + K3 * Cr + * B = Y + K4 * Cb * only the Y term varies among the group of pixels corresponding to a pair * of chroma samples, so the rest of the terms can be calculated just once. * At typical sampling ratios, this eliminates half or three-quarters of the * multiplications needed for color conversion. * * This file currently provides implementations for the following cases: - * YCbCr => RGB color conversion only. - * Sampling ratios of 2h1v or 2h2v. - * No scaling needed at upsample time. - * Corner-aligned (non-CCIR601) sampling alignment. + * YCbCr => RGB color conversion only. + * Sampling ratios of 2h1v or 2h2v. + * No scaling needed at upsample time. + * Corner-aligned (non-CCIR601) sampling alignment. * Other special cases could be added, but in most applications these are * the only common cases. (For uncommon cases we fall back on the more * general code in jdsample.c and jdcolor.c.) diff --git a/src/lib/libjpeg/jdsample.c b/src/lib/libjpeg/jdsample.c index 7bc8885b02e..1be3f725582 100644 --- a/src/lib/libjpeg/jdsample.c +++ b/src/lib/libjpeg/jdsample.c @@ -119,7 +119,7 @@ sep_upsample (j_decompress_ptr cinfo, /* Not more than the distance to the end of the image. Need this test * in case the image height is not a multiple of max_v_samp_factor: */ - if (num_rows > upsample->rows_to_go) + if (num_rows > upsample->rows_to_go) num_rows = upsample->rows_to_go; /* And not more than what the client can accept: */ out_rows_avail -= *out_row_ctr; diff --git a/src/lib/libjpeg/jerror.c b/src/lib/libjpeg/jerror.c index 3da7be86a00..d63d8b10e6a 100644 --- a/src/lib/libjpeg/jerror.c +++ b/src/lib/libjpeg/jerror.c @@ -220,10 +220,10 @@ reset_error_mgr (j_common_ptr cinfo) /* * Fill in the standard error-handling methods in a jpeg_error_mgr object. * Typical call is: - * struct jpeg_compress_struct cinfo; - * struct jpeg_error_mgr err; + * struct jpeg_compress_struct cinfo; + * struct jpeg_error_mgr err; * - * cinfo.err = jpeg_std_error(&err); + * cinfo.err = jpeg_std_error(&err); * after which the application may override some of the methods. */ diff --git a/src/lib/libjpeg/jidctflt.c b/src/lib/libjpeg/jidctflt.c index 23ae9d333b7..ae040eab77e 100644 --- a/src/lib/libjpeg/jidctflt.c +++ b/src/lib/libjpeg/jidctflt.c @@ -95,14 +95,14 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, * With typical images and quantization tables, half or more of the * column DCT calculations can be simplified this way. */ - + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { /* AC terms all zero */ FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - + wsptr[DCTSIZE*0] = dcval; wsptr[DCTSIZE*1] = dcval; wsptr[DCTSIZE*2] = dcval; @@ -111,13 +111,13 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = dcval; wsptr[DCTSIZE*6] = dcval; wsptr[DCTSIZE*7] = dcval; - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; continue; } - + /* Even part */ tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); @@ -135,7 +135,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp3 = tmp10 - tmp13; tmp1 = tmp11 + tmp12; tmp2 = tmp11 - tmp12; - + /* Odd part */ tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); @@ -172,7 +172,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, quantptr++; wsptr++; } - + /* Pass 2: process rows from work array, store into output array. */ wsptr = workspace; @@ -183,7 +183,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, * the simplification applies less often (typically 5% to 10% of the time). * And testing floats for zero is relatively expensive, so we don't bother. */ - + /* Even part */ /* Apply signed->unsigned and prepare float->int conversion */ @@ -227,7 +227,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK]; outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK]; outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK]; - + wsptr += DCTSIZE; /* advance pointer to next row */ } } diff --git a/src/lib/libjpeg/jidctfst.c b/src/lib/libjpeg/jidctfst.c index dba4216fb95..af3f7733d03 100644 --- a/src/lib/libjpeg/jidctfst.c +++ b/src/lib/libjpeg/jidctfst.c @@ -196,7 +196,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, * With typical images and quantization tables, half or more of the * column DCT calculations can be simplified this way. */ - + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && @@ -212,13 +212,13 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = dcval; wsptr[DCTSIZE*6] = dcval; wsptr[DCTSIZE*7] = dcval; - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; continue; } - + /* Even part */ tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); @@ -236,7 +236,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp3 = tmp10 - tmp13; tmp1 = tmp11 + tmp12; tmp2 = tmp11 - tmp12; - + /* Odd part */ tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); @@ -273,7 +273,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, quantptr++; wsptr++; } - + /* Pass 2: process rows from work array, store into output array. */ /* Note that we must descale the results by a factor of 8 == 2**3, */ /* and also undo the PASS1_BITS scaling. */ @@ -288,14 +288,14 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, * test takes more time than it's worth. In that case this section * may be commented out. */ - + #ifndef NO_ZERO_ROW_TEST if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { /* AC terms all zero */ JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) & RANGE_MASK]; - + outptr[0] = dcval; outptr[1] = dcval; outptr[2] = dcval; @@ -309,7 +309,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, continue; } #endif - + /* Even part */ tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); diff --git a/src/lib/libjpeg/jidctint.c b/src/lib/libjpeg/jidctint.c index dcdf7ce4547..07096b1081f 100644 --- a/src/lib/libjpeg/jidctint.c +++ b/src/lib/libjpeg/jidctint.c @@ -225,7 +225,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ - + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); @@ -256,7 +256,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; @@ -288,7 +288,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; @@ -332,7 +332,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ - + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; @@ -346,7 +346,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -835,7 +835,7 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - + tmp10 = (tmp0 + tmp2) << PASS1_BITS; tmp12 = (tmp0 - tmp2) << PASS1_BITS; @@ -2851,14 +2851,14 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * With typical images and quantization tables, half or more of the * column DCT calculations can be simplified this way. */ - + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { /* AC terms all zero */ int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; - + wsptr[DCTSIZE*0] = dcval; wsptr[DCTSIZE*1] = dcval; wsptr[DCTSIZE*2] = dcval; @@ -2867,23 +2867,23 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = dcval; wsptr[DCTSIZE*6] = dcval; wsptr[DCTSIZE*7] = dcval; - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; continue; } - + /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ - + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z2 <<= CONST_BITS; @@ -2893,21 +2893,21 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = z2 + z3; tmp1 = z2 - z3; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; tmp12 = tmp1 - tmp3; - + /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; @@ -2928,9 +2928,9 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ tmp1 += z1 + z3; tmp2 += z1 + z2; - + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - + wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS); @@ -2939,7 +2939,7 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; @@ -3688,18 +3688,18 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; - + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + /* Add fudge factor here for final descale. */ z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[4]; - + tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -3819,7 +3819,7 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[6*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); wsptr[6*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS); } - + /* Pass 2: process 3 rows from work array, store into output array. * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ @@ -4134,7 +4134,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS); wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS); } - + /* Pass 2: process rows from work array, store into output array. */ /* Note that we must descale the results by a factor of 8 == 2**3, */ /* and also undo the PASS1_BITS scaling. */ @@ -4142,38 +4142,38 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr = workspace; for (ctr = 0; ctr < 16; ctr++) { outptr = output_buf[ctr] + output_col; - + /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ - + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; - + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + /* Add fudge factor here for final descale. */ z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[4]; - + tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; tmp12 = tmp1 - tmp3; - + /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - + tmp0 = (INT32) wsptr[7]; tmp1 = (INT32) wsptr[5]; tmp2 = (INT32) wsptr[3]; tmp3 = (INT32) wsptr[1]; - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; @@ -4194,9 +4194,9 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ tmp1 += z1 + z3; tmp2 += z1 + z2; - + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; @@ -4221,7 +4221,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; - + wsptr += DCTSIZE; /* advance pointer to next row */ } } @@ -4794,11 +4794,11 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z2 <<= CONST_BITS; @@ -4808,7 +4808,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = z2 + z3; tmp1 = z2 - z3; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -4900,7 +4900,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; - + wsptr += 4; /* advance pointer to next row */ } } @@ -5116,7 +5116,7 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; /* Even part */ - + tmp10 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); /* Add fudge factor here for final descale. */ tmp10 += ONE << 2; diff --git a/src/lib/libjpeg/jmemmgr.c b/src/lib/libjpeg/jmemmgr.c index d801b322da0..06a4ad24c19 100644 --- a/src/lib/libjpeg/jmemmgr.c +++ b/src/lib/libjpeg/jmemmgr.c @@ -238,13 +238,13 @@ out_of_memory (j_common_ptr cinfo, int which) * machines, but may be too small if longs are 64 bits or more. */ -static const size_t first_pool_slop[JPOOL_NUMPOOLS] = +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = { 1600, /* first PERMANENT pool */ 16000 /* first IMAGE pool */ }; -static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = { 0, /* additional PERMANENT pools */ 5000 /* additional IMAGE pools */ diff --git a/src/lib/libjpeg/jpeglib.h b/src/lib/libjpeg/jpeglib.h index 1eb1fac033f..9f57e8d596c 100644 --- a/src/lib/libjpeg/jpeglib.h +++ b/src/lib/libjpeg/jpeglib.h @@ -137,9 +137,9 @@ typedef struct { /* The decompressor output side may not use these variables. */ int dc_tbl_no; /* DC entropy table selector (0..3) */ int ac_tbl_no; /* AC entropy table selector (0..3) */ - + /* Remaining fields should be treated as private by applications. */ - + /* These values are computed during compression or decompression startup: */ /* Component's size in DCT blocks. * Any dummy blocks added to complete an MCU are not counted; therefore @@ -369,7 +369,7 @@ struct jpeg_compress_struct { UINT16 X_density; /* Horizontal pixel density */ UINT16 Y_density; /* Vertical pixel density */ boolean write_Adobe_marker; /* should an Adobe marker be written? */ - + /* State variable: index of next scanline to be written to * jpeg_write_scanlines(). Application may use this to control its * processing loop, e.g., "while (next_scanline < image_height)". @@ -397,7 +397,7 @@ struct jpeg_compress_struct { * There are v_samp_factor * DCTSIZE sample rows of each component in an * "iMCU" (interleaved MCU) row. */ - + /* * These fields are valid during any one scan. * They describe the components and MCUs actually appearing in the scan. @@ -405,10 +405,10 @@ struct jpeg_compress_struct { int comps_in_scan; /* # of JPEG components in this scan */ jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; /* *cur_comp_info[i] describes component that appears i'th in SOS */ - + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - + int blocks_in_MCU; /* # of DCT blocks per MCU */ int MCU_membership[C_MAX_BLOCKS_IN_MCU]; /* MCU_membership[i] is index in cur_comp_info of component owning */ @@ -691,7 +691,7 @@ struct jpeg_error_mgr { #define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ /* Reset error state variables at start of a new image */ JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - + /* The message ID code and any parameters are saved here. * A message can have one string parameter or up to 8 int parameters. */ @@ -701,11 +701,11 @@ struct jpeg_error_mgr { int i[8]; char s[JMSG_STR_PARM_MAX]; } msg_parm; - + /* Standard state variables for error facility */ - + int trace_level; /* max msg_level that will be displayed */ - + /* For recoverable corrupt-data errors, we emit a warning message, * but keep going unless emit_message chooses to abort. emit_message * should count warnings in num_warnings. The surrounding application @@ -863,7 +863,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); /* Short forms of external names for systems with brain-damaged linkers. * We shorten external names to be unique in the first six letters, which * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 + * (If your compiler itself needs names to be unique in less than 15 * characters, you are out of luck. Get a better compiler.) */ @@ -1049,7 +1049,7 @@ EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); /* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ #define JPEG_REACHED_SOS 1 /* Reached start of new scan */ #define JPEG_REACHED_EOI 2 /* Reached end of image */ #define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ diff --git a/src/lib/libjpeg/jpegtran.c b/src/lib/libjpeg/jpegtran.c index 8cb3d807fbb..fb24a43e346 100644 --- a/src/lib/libjpeg/jpegtran.c +++ b/src/lib/libjpeg/jpegtran.c @@ -378,7 +378,7 @@ main (int argc, char **argv) jvirt_barray_ptr * dst_coef_arrays; int file_index; /* We assume all-in-memory processing and can therefore use only a - * single file pointer for sequential input and output operation. + * single file pointer for sequential input and output operation. */ FILE * fp; diff --git a/src/lib/libjpeg/jquant1.c b/src/lib/libjpeg/jquant1.c index b2f96aa15d2..40c4cf45f31 100644 --- a/src/lib/libjpeg/jquant1.c +++ b/src/lib/libjpeg/jquant1.c @@ -105,8 +105,8 @@ static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { * Errors are accumulated into the array fserrors[], at a resolution of * 1/16th of a pixel count. The error at a given pixel is propagated * to its not-yet-processed neighbors using the standard F-S fractions, - * ... (here) 7/16 - * 3/16 5/16 1/16 + * ... (here) 7/16 + * 3/16 5/16 1/16 * We work left-to-right on even rows, right-to-left on odd rows. * * We can get away with a single array (holding one row's worth of errors) @@ -424,7 +424,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors) /* * Create the ordered-dither tables. - * Components having the same number of representative colors may + * Components having the same number of representative colors may * share a dither table. */ @@ -542,12 +542,12 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, for (col = width; col > 0; col--) { /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, - * select output value, accumulate into output code for this pixel. - * Range-limiting need not be done explicitly, as we have extended - * the colorindex table to produce the right answers for out-of-range - * inputs. The maximum dither is +- MAXJSAMPLE; this sets the - * required amount of padding. - */ + * select output value, accumulate into output code for this pixel. + * Range-limiting need not be done explicitly, as we have extended + * the colorindex table to produce the right answers for out-of-range + * inputs. The maximum dither is +- MAXJSAMPLE; this sets the + * required amount of padding. + */ *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]; input_ptr += nc; output_ptr++; @@ -662,18 +662,18 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, for (col = width; col > 0; col--) { /* cur holds the error propagated from the previous pixel on the - * current line. Add the error propagated from the previous line - * to form the complete error correction term for this pixel, and - * round the error term (which is expressed * 16) to an integer. - * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct - * for either sign of the error value. - * Note: errorptr points to *previous* column's array entry. - */ + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. - * The maximum error is +- MAXJSAMPLE; this sets the required size - * of the range_limit array. - */ + * The maximum error is +- MAXJSAMPLE; this sets the required size + * of the range_limit array. + */ cur += GETJSAMPLE(*input_ptr); cur = GETJSAMPLE(range_limit[cur]); /* Select output value, accumulate into output code for this pixel */ @@ -684,9 +684,9 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, /* pixel code, because the colormap is orthogonal. */ cur -= GETJSAMPLE(colormap_ci[pixcode]); /* Compute error fractions to be propagated to adjacent pixels. - * Add these into the running sums, and simultaneously shift the - * next-line error sums left by 1 column. - */ + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ bnexterr = cur; delta = cur * 2; cur += delta; /* form error * 3 */ @@ -696,9 +696,9 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, belowerr = bnexterr; cur += delta; /* form error * 7 */ /* At this point cur contains the 7/16 error value to be propagated - * to the next pixel on the current line, and all the errors for the - * next line have been shifted over. We are therefore ready to move on. - */ + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ input_ptr += dirnc; /* advance input ptr to next column */ output_ptr += dir; /* advance output ptr to next column */ errorptr += dir; /* advance errorptr to current column */ diff --git a/src/lib/libjpeg/jquant2.c b/src/lib/libjpeg/jquant2.c index af601e334b2..abd0a3db9bd 100644 --- a/src/lib/libjpeg/jquant2.c +++ b/src/lib/libjpeg/jquant2.c @@ -41,7 +41,7 @@ * color space, and repeatedly splits the "largest" remaining box until we * have as many boxes as desired colors. Then the mean color in each * remaining box becomes one of the possible output colors. - * + * * The second pass over the image maps each input pixel to the closest output * color (optionally after applying a Floyd-Steinberg dithering correction). * This mapping is logically trivial, but making it go fast enough requires @@ -158,8 +158,8 @@ typedef hist2d * hist3d; /* type for top-level pointer */ * Errors are accumulated into the array fserrors[], at a resolution of * 1/16th of a pixel count. The error at a given pixel is propagated * to its not-yet-processed neighbors using the standard F-S fractions, - * ... (here) 7/16 - * 3/16 5/16 1/16 + * ... (here) 7/16 + * 3/16 5/16 1/16 * We work left-to-right on even rows, right-to-left on odd rows. * * We can get away with a single array (holding one row's worth of errors) @@ -278,7 +278,7 @@ find_biggest_color_pop (boxptr boxlist, int numboxes) register int i; register long maxc = 0; boxptr which = NULL; - + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { if (boxp->colorcount > maxc && boxp->volume > 0) { which = boxp; @@ -298,7 +298,7 @@ find_biggest_volume (boxptr boxlist, int numboxes) register int i; register INT32 maxv = 0; boxptr which = NULL; - + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { if (boxp->volume > maxv) { which = boxp; @@ -321,11 +321,11 @@ update_box (j_decompress_ptr cinfo, boxptr boxp) int c0min,c0max,c1min,c1max,c2min,c2max; INT32 dist0,dist1,dist2; long ccount; - + c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; - + if (c0max > c0min) for (c0 = c0min; c0 <= c0max; c0++) for (c1 = c1min; c1 <= c1max; c1++) { @@ -405,7 +405,7 @@ update_box (j_decompress_ptr cinfo, boxptr boxp) dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; - + /* Now scan remaining volume of box and compute population */ ccount = 0; for (c0 = c0min; c0 <= c0max; c0++) @@ -511,11 +511,11 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) long c0total = 0; long c1total = 0; long c2total = 0; - + c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; - + for (c0 = c0min; c0 <= c0max; c0++) for (c1 = c1min; c1 <= c1max; c1++) { histp = & histogram[c0][c1][c2min]; @@ -528,7 +528,7 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) } } } - + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); @@ -797,17 +797,17 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, bptr = bestdist; for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) *bptr++ = 0x7FFFFFFFL; - + /* For each color selected by find_nearby_colors, * compute its distance to the center of each cell in the box. * If that's less than best-so-far, update best distance and color number. */ - + /* Nominal steps between cell centers ("x" in Thomas article) */ #define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) #define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) #define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) - + for (i = 0; i < numcolors; i++) { icolor = GETJSAMPLE(colorlist[i]); /* Compute (square of) distance from minc0/c1/c2 to this color */ @@ -881,7 +881,7 @@ fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); - + /* Determine which colormap entries are close enough to be candidates * for the nearest entry to some cell in the update box. */ diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index ccc5c058d3c..070d097ac9e 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -2142,7 +2142,7 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN offset++; } for (secoff=0;secoff<CD_MAX_SUBCODE_DATA;secoff++) - { + { if (src[offset]!=0x00) is_likely_cd = false; @@ -2171,13 +2171,13 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN tempbytes = bytes; temperror = err; tempstrategy = 0; - } + } /* try strategy 1 - flac */ if (chd->codecintf->secondary_compress != NULL) { strategy = 1; - + err = (*chd->codecintf->secondary_compress)(chd, src, &bytes); /* check against previous compression attempt if that was successful */ @@ -2217,7 +2217,7 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN { data = chd->compressed; newentry.length = bytes; - + if (strategy == 0) { newentry.flags = MAP_ENTRY_TYPE_COMPRESSED; @@ -3085,7 +3085,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len printf("ERROR: allocating encoder\n"); return CHDERR_COMPRESSION_ERROR; } - + ok &= FLAC__stream_encoder_set_verify(encoder, false); // we trust libFLAC ;-) ok &= FLAC__stream_encoder_set_compression_level(encoder, 8); ok &= FLAC__stream_encoder_set_channels(encoder, 2); @@ -3094,7 +3094,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len ok &= FLAC__stream_encoder_set_total_samples_estimate(encoder, 0); ok &= FLAC__stream_encoder_set_streamable_subset(encoder, false); ok &= FLAC__stream_encoder_set_blocksize(encoder, ((CD_MAX_SECTOR_DATA)*CD_FRAMES_PER_HUNK) ); - + if (!ok) { printf("error setting up stream encoder\n"); @@ -3121,7 +3121,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len if (!swap) flac_encoder_client_ptr->pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)flac_encoder_client_ptr->tempbuffer[2*i] << 8) | (FLAC__int16)flac_encoder_client_ptr->tempbuffer[2*i+1]); else flac_encoder_client_ptr->pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)flac_encoder_client_ptr->tempbuffer[2*i+1] << 8) | (FLAC__int16)flac_encoder_client_ptr->tempbuffer[2*i]); } - + ok = FLAC__stream_encoder_process_interleaved(encoder, flac_encoder_client_ptr->pcm, FLAC_ENCODER_READSIZE); } @@ -3142,10 +3142,10 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len printf("error finishing!\n"); return CHDERR_COMPRESSION_ERROR; } - + int totalout = flac_encoder_client_ptr->flac_output_buffer_total-FLAC_HEADER_SIZE; - + FLAC__stream_encoder_delete(encoder); @@ -3197,9 +3197,9 @@ struct flac_decoder_data UINT64 amount_to_decode; }; -FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) +FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) { - + int blocksize = frame->header.blocksize; int i = 0; while (blocksize && ((flac_decoder_data*)client_data)->amount_to_decode) @@ -3212,7 +3212,7 @@ FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDec ((flac_decoder_data*)client_data)->amount_to_decode-=4; ((flac_decoder_data*)client_data)->writeoffset++; } - + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } @@ -3237,12 +3237,12 @@ FLAC__StreamDecoderReadStatus flac_decoder_read_callback(const FLAC__StreamDecod -void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) +void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) { } -void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) +void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) { } @@ -3259,7 +3259,7 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de flac_decoder_client_ptr->readbuffer = (UINT8*)malloc(flac_decoder_client_ptr->readbuffersize); flac_decoder_client_ptr->amount_to_decode = (CD_MAX_SECTOR_DATA*CD_FRAMES_PER_HUNK); int frames_to_decode = flac_decoder_client_ptr->amount_to_decode / CD_MAX_SECTOR_DATA; - + flac_decoder_client_ptr->writeoffset = 0; memcpy(flac_decoder_client_ptr->readbuffer, flacHeader, FLAC_HEADER_SIZE); @@ -3274,7 +3274,7 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de if(FLAC__stream_decoder_init_stream( decoder, flac_decoder_read_callback, - NULL, + NULL, NULL, NULL, NULL, @@ -3300,13 +3300,13 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de return CHDERR_READ_ERROR; } - + int srcoffset = 0; UINT8* dest2 = (UINT8*)dest; for (int frame = 0; frame<frames_to_decode;frame++) { int destoffset = frame * (CD_FRAME_SIZE); - + int index; @@ -3314,11 +3314,11 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de { dest2[ destoffset + index +1 ] = flac_decoder_client_ptr->tempbuffer[srcoffset] & 0xff; dest2[ destoffset + index ] = flac_decoder_client_ptr->tempbuffer[srcoffset] >> 8; - + srcoffset++; } } - + if (FLAC__stream_decoder_finish (decoder) != true) { diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h index a3ba8bf85b0..4bbe458f92b 100644 --- a/src/lib/util/tagmap.h +++ b/src/lib/util/tagmap.h @@ -78,7 +78,7 @@ public: class entry_t { friend class tagmap_t<_ElementType, _HashSize>; - + public: // construction/destruction entry_t(const char *tag, UINT32 fullhash, _ElementType object) @@ -86,11 +86,11 @@ public: m_fullhash(fullhash), m_tag(tag), m_object(object) { } - + // accessors const astring &tag() const { return m_tag; } _ElementType object() const { return m_object; } - + // setters void set_object(_ElementType object) { m_object = object; } @@ -151,7 +151,7 @@ public: // find by tag _ElementType find(const char *tag) const { return find(tag, hash(tag)); } - + // find by tag with precomputed hash _ElementType find(const char *tag, UINT32 fullhash) const { @@ -170,10 +170,10 @@ public: return entry->object(); return NULL; } - + // return first object in the table entry_t *first() const { return next(NULL); } - + // return next object in the table entry_t *next(entry_t *after) const { @@ -186,7 +186,7 @@ public: for (UINT32 hashindex = firstindex; hashindex < ARRAY_LENGTH(m_table); hashindex++) if (m_table[hashindex] != NULL) return m_table[hashindex]; - + // all out return NULL; } @@ -194,7 +194,7 @@ public: private: // internal helpers tagmap_error add_common(const char *tag, _ElementType object, bool replace_if_duplicate, bool unique_hash); - + // remove an entry given a pointer to its pointer void remove_common(entry_t **entryptr) { @@ -214,7 +214,7 @@ private: //************************************************************************** //------------------------------------------------- -// add_common - core implementation of a tagmap +// add_common - core implementation of a tagmap // addition //------------------------------------------------- diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c index b02245f7f72..c96624d6711 100644 --- a/src/mame/drivers/bnstars.c +++ b/src/mame/drivers/bnstars.c @@ -245,7 +245,7 @@ static void draw_roz(running_machine &machine, bitmap_ind16 &bitmap, const recta if (incxx & 0x10000) incxx |= ~0x1ffff; if (incxy & 0x10000) incxy |= ~0x1ffff; - state->m_ms32_roz_tilemap->draw_roz(bitmap, &my_clip, + state->m_ms32_roz_tilemap->draw_roz(bitmap, &my_clip, (start2x+startx+offsx)<<16, (start2y+starty+offsy)<<16, incxx<<8, incxy<<8, 0, 0, 1, // Wrap @@ -277,7 +277,7 @@ static void draw_roz(running_machine &machine, bitmap_ind16 &bitmap, const recta if (incyy & 0x10000) incyy |= ~0x1ffff; if (incyx & 0x10000) incyx |= ~0x1ffff; - state->m_ms32_roz_tilemap[chip]->draw_roz(bitmap, cliprect, + state->m_ms32_roz_tilemap[chip]->draw_roz(bitmap, cliprect, (startx+offsx)<<16, (starty+offsy)<<16, incxx<<8, incxy<<8, incyx<<8, incyy<<8, 1, // Wrap diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 1b7dd1b23f2..c5b43397506 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -290,7 +290,7 @@ static SCREEN_UPDATE_IND16( zerotrgt ) x = -256 - (state->m_scrollx | state->m_scrollx_hi); y = 256 + (state->m_scrolly | state->m_scrolly_hi); - state->m_bg_tilemap->draw_roz(bitmap, cliprect, + state->m_bg_tilemap->draw_roz(bitmap, cliprect, (x << 16), (y << 16), p1, p2, p3, p4, @@ -339,7 +339,7 @@ static SCREEN_UPDATE_IND16( cntsteer ) x = 256 + (state->m_scrollx | state->m_scrollx_hi); y = 256 - (state->m_scrolly | state->m_scrolly_hi); - state->m_bg_tilemap->draw_roz(bitmap, cliprect, + state->m_bg_tilemap->draw_roz(bitmap, cliprect, (x << 16), (y << 16), p1, p2, p3, p4, diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c index d6ed89c3a03..0b25a0eba26 100644 --- a/src/mame/drivers/cybertnk.c +++ b/src/mame/drivers/cybertnk.c @@ -851,7 +851,7 @@ static const gfx_layout roadlayout = { 0 }, 1024*4, xoffsets -}; +}; static GFXDECODE_START( cybertnk ) GFXDECODE_ENTRY( "gfx1", 0, tile_8x8x4, 0x1400, 16 ) /*Pal offset???*/ diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c index 8783cd52048..4171c708ff6 100644 --- a/src/mame/drivers/dassault.c +++ b/src/mame/drivers/dassault.c @@ -578,7 +578,7 @@ static MACHINE_CONFIG_START( dassault, dassault_state ) MCFG_CPU_ADD("audiocpu", H6280,32220000/8) /* Accurate */ MCFG_CPU_PROGRAM_MAP(sound_map) -// MCFG_QUANTUM_TIME(attotime::from_hz(8400)) /* 140 CPU slices per frame */ +// MCFG_QUANTUM_TIME(attotime::from_hz(8400)) /* 140 CPU slices per frame */ MCFG_QUANTUM_PERFECT_CPU("maincpu") // I was seeing random lockups.. let's see if this helps /* video hardware */ diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c index 25f425ef93c..97362c1341f 100644 --- a/src/mame/drivers/dreamwld.c +++ b/src/mame/drivers/dreamwld.c @@ -340,7 +340,7 @@ static SCREEN_UPDATE_IND16( dreamwld ) x0 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) } - + tmptilemap0->set_scrollx( (i + layer0_scrolly) % 256 /*tilemap_width(tm0size) */, layer0_scrollx + x0 ); @@ -357,7 +357,7 @@ static SCREEN_UPDATE_IND16( dreamwld ) x1 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) } - + tmptilemap1->set_scrollx( (i + layer1_scrolly) % 256 /* tilemap_width(tm1size) */, layer1_scrollx + x1 ); diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c index f29dd76035f..52560860a64 100644 --- a/src/mame/drivers/eolithsp.c +++ b/src/mame/drivers/eolithsp.c @@ -101,22 +101,22 @@ TIMER_DEVICE_CALLBACK( eolith_speedup ) CUSTOM_INPUT( eolith_speedup_getvblank ) { -// printf("%s:eolith speedup_read data %02x\n",field.machine().describe_context(), eolith_vblank); - +// printf("%s:eolith speedup_read data %02x\n",field.machine().describe_context(), eolith_vblank); + return (field.machine().primary_screen->vpos() >= 240); } -// StealSee doesn't use interrupts, just the vblank +// StealSee doesn't use interrupts, just the vblank CUSTOM_INPUT( stealsee_speedup_getvblank ) { eolith_state *state = field.machine().driver_data<eolith_state>(); int pc = cpu_get_pc(state->m_maincpu); - + if (pc==0x400081ec) if(!eolith_vblank) device_eat_cycles(state->m_maincpu, 500); - + return (field.machine().primary_screen->vpos() >= 240); } diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c index bd4ddeb2780..8f8d7a1f04a 100644 --- a/src/mame/drivers/gberet.c +++ b/src/mame/drivers/gberet.c @@ -91,7 +91,7 @@ static TIMER_DEVICE_CALLBACK( gberet_interrupt_tick ) // NMI on d0 if (ticks_mask & state->m_interrupt_mask & 1) cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE); - + // IRQ on d3 (used by mrgoemon) if (ticks_mask & state->m_interrupt_mask<<2 & 8) cputag_set_input_line(timer.machine(), "maincpu", 0, ASSERT_LINE); diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index f0944496662..fb735d638bc 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -3954,16 +3954,16 @@ ROM_START( mtkob2 ) NAOMI_DEFAULT_EEPROM ROM_REGION( 0x4000000, "rom_board", ROMREGION_ERASEFF) - ROM_LOAD( "epr-24217.ic11", 0x0000000, 0x0400000, CRC(5ecf807b) SHA1(f91d03a68a44d02970e360789b746bec9289275f) ) - ROM_LOAD32_WORD( "mpr-24218.ic17s", 0x1000000, 0x0800000, CRC(e8c51e1d) SHA1(e81f0580e144aa7a7e8c9399ffa09227b6e93675) ) - ROM_LOAD32_WORD( "mpr-24219.ic18", 0x1000002, 0x0800000, CRC(b0a5709f) SHA1(993f7a99d59a924641c37a549208723342007e5a) ) - ROM_LOAD32_WORD( "mpr-24220.ic19s", 0x2000000, 0x0800000, CRC(9f6cefe2) SHA1(499e17d2c284b340db6b124b63a23c7fa5045d0f) ) - ROM_LOAD32_WORD( "mpr-24221.ic20", 0x2000002, 0x0800000, CRC(73bf9cc6) SHA1(ab187cc0babd1435f5e8636331818d81de23636f) ) - ROM_LOAD32_WORD( "mpr-24222.ic21s", 0x3000000, 0x0800000, CRC(7098e728) SHA1(82f4f57efcee3063467c24758cefd406dccb1ea4) ) - ROM_LOAD32_WORD( "mpr-24223.ic22", 0x3000002, 0x0800000, CRC(eca13c90) SHA1(26a66906bf4ebda8697140d89eb5e493e941e8b2) ) + ROM_LOAD( "epr-24217.ic11", 0x0000000, 0x0400000, CRC(5ecf807b) SHA1(f91d03a68a44d02970e360789b746bec9289275f) ) + ROM_LOAD32_WORD( "mpr-24218.ic17s", 0x1000000, 0x0800000, CRC(e8c51e1d) SHA1(e81f0580e144aa7a7e8c9399ffa09227b6e93675) ) + ROM_LOAD32_WORD( "mpr-24219.ic18", 0x1000002, 0x0800000, CRC(b0a5709f) SHA1(993f7a99d59a924641c37a549208723342007e5a) ) + ROM_LOAD32_WORD( "mpr-24220.ic19s", 0x2000000, 0x0800000, CRC(9f6cefe2) SHA1(499e17d2c284b340db6b124b63a23c7fa5045d0f) ) + ROM_LOAD32_WORD( "mpr-24221.ic20", 0x2000002, 0x0800000, CRC(73bf9cc6) SHA1(ab187cc0babd1435f5e8636331818d81de23636f) ) + ROM_LOAD32_WORD( "mpr-24222.ic21s", 0x3000000, 0x0800000, CRC(7098e728) SHA1(82f4f57efcee3063467c24758cefd406dccb1ea4) ) + ROM_LOAD32_WORD( "mpr-24223.ic22", 0x3000002, 0x0800000, CRC(eca13c90) SHA1(26a66906bf4ebda8697140d89eb5e493e941e8b2) ) ROM_REGION( 4, "rom_key", 0 ) - ROM_LOAD( "mtkob2-key.bin", 0x000000, 0x000004, CRC(db088208) SHA1(14d65ad2555183a445abcd93907c85df4032b41d) ) + ROM_LOAD( "mtkob2-key.bin", 0x000000, 0x000004, CRC(db088208) SHA1(14d65ad2555183a445abcd93907c85df4032b41d) ) ROM_END ROM_START( crackndj ) @@ -5135,7 +5135,7 @@ ROM_START( virnbap ) NAOMI_DEFAULT_EEPROM ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF) - ROM_LOAD("vnbaearly.ic22",0x0000000, 0x0400000, CRC(5bbf7a45) SHA1(ad71ae8e9e08d7e0a9a60d1ba51bc5dcfeb0f50c) ) + ROM_LOAD("vnbaearly.ic22",0x0000000, 0x0400000, CRC(5bbf7a45) SHA1(ad71ae8e9e08d7e0a9a60d1ba51bc5dcfeb0f50c) ) ROM_LOAD("mpr-22928.ic1", 0x0800000, 0x0800000, CRC(63245c98) SHA1(a5a542244f07c6c8b66961a231fb56c89d2cf20c) ) ROM_LOAD("mpr-22929.ic2", 0x1000000, 0x0800000, CRC(eea89d21) SHA1(5fe184267e637f155d767f8d931462d9593eff5a) ) ROM_LOAD("mpr-22930.ic3", 0x1800000, 0x0800000, CRC(2fbefa9a) SHA1(a6df46cb8742022e436cdc6a9a50490c7a551421) ) @@ -7793,7 +7793,7 @@ ROM_END /* 0126 */ GAME( 2003, oinori, naomi, naomi, naomi, naomi, ROT0, "Sega", "Oinori-daimyoujin Matsuri", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) /* 0128 */ GAME( 2002, shootpl, naomi, naomim1, naomi, naomi, ROT0, "Sega", "Shootout Pool (JPN, USA, KOR, AUS) / Shootout Pool Prize (EXP)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) /* 0140 */ GAME( 2004, kick4csh, naomi, naomim1, naomi, kick4csh, ROT0, "Sega", "Kick '4' Cash", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) -/* 0150 */ GAME( 2003, mtkob2, naomi, naomim1, naomi, naomi, ROT0, "Sega", "Mushiking The King Of Beetle 2K3 2nd", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) +/* 0150 */ GAME( 2003, mtkob2, naomi, naomim1, naomi, naomi, ROT0, "Sega", "Mushiking The King Of Beetle 2K3 2nd", GAME_UNEMULATED_PROTECTION|GAME_FLAGS ) // 0164 MushiKing The King Of Beetle II ENG // 0166 Touch De Zunou (Japan) // 0166 Touch De Zunou (Japan) (Rev A) diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c index 6a0a5cf0080..049a3f4e3e9 100644 --- a/src/mame/drivers/nemesis.c +++ b/src/mame/drivers/nemesis.c @@ -814,7 +814,7 @@ static INPUT_PORTS_START( rf2 ) PORT_START("DSW1") PORT_BIT( 0x4f, IP_ACTIVE_LOW, IPT_UNUSED ) - + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6") PORT_DIPSETTING( 0x30, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) @@ -1216,7 +1216,7 @@ static INPUT_PORTS_START( citybomb ) PORT_START("DSW1") PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:2" ) + PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:2" ) PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) ) diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c index c91610c5ee2..300cb21b6a8 100644 --- a/src/mame/drivers/neodrvr.c +++ b/src/mame/drivers/neodrvr.c @@ -8882,7 +8882,7 @@ ROM_START( sbp ) /* Unlicensed, no official game ID # */ ROM_IGNORE(0x20000) ROM_REGION( 0x20000, "fixedbios", 0 ) - ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) + ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) ROM_Y_ZOOM NEO_BIOS_AUDIO_512K( "1b.bin", CRC(7b1f86f7) SHA1(15b6af7f9fbd0f1f6a1ecd912200ca8d0af2da2a) ) diff --git a/src/mame/drivers/nexus3d.c b/src/mame/drivers/nexus3d.c index d7bd5a2d034..3981814ba28 100644 --- a/src/mame/drivers/nexus3d.c +++ b/src/mame/drivers/nexus3d.c @@ -127,12 +127,12 @@ static READ32_HANDLER( nexus3d_unk_r ) //static READ32_HANDLER( nexus3d_unk2_r ) //{ -// return 0x00000000;//space->machine().rand() ^ (space->machine().rand() << 16); +// return 0x00000000;//space->machine().rand() ^ (space->machine().rand() << 16); //} // //static READ32_HANDLER( nexus3d_unk3_r ) //{ -// return 0x00000000;//space->machine().rand() ^ (space->machine().rand() << 16); +// return 0x00000000;//space->machine().rand() ^ (space->machine().rand() << 16); //} // //static WRITE32_HANDLER( nexus3d_unk2_w ) @@ -156,8 +156,8 @@ static ADDRESS_MAP_START( nexus3d_map, AS_PROGRAM, 32 ) AM_RANGE(0x9C000018, 0x9C00001b) AM_WRITE8( n3d_flash_addr_w, 0xffffffff) // lots of accesses in this range -// AM_RANGE(0xC0000F44, 0xC0000F47) AM_READWRITE( nexus3d_unk2_r, nexus3d_unk2_w ) // often -// AM_RANGE(0xC0000F4C, 0xC0000F4f) AM_READWRITE( nexus3d_unk3_r, nexus3d_unk3_w ) // often +// AM_RANGE(0xC0000F44, 0xC0000F47) AM_READWRITE( nexus3d_unk2_r, nexus3d_unk2_w ) // often +// AM_RANGE(0xC0000F4C, 0xC0000F4f) AM_READWRITE( nexus3d_unk3_r, nexus3d_unk3_w ) // often AM_RANGE(0xE0000014, 0xE0000017) AM_READ( nexus3d_unk_r ) // sits waiting for this diff --git a/src/mame/drivers/pluto5.c b/src/mame/drivers/pluto5.c index 3ce1bc1eefb..4e93c35c92b 100644 --- a/src/mame/drivers/pluto5.c +++ b/src/mame/drivers/pluto5.c @@ -27,7 +27,7 @@ --------------------------------------------------------------------- - Pluto 5 Technical Notes.... + Pluto 5 Technical Notes.... * Clocks... diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c index 933cd57125c..58f66586810 100644 --- a/src/mame/drivers/pntnpuzl.c +++ b/src/mame/drivers/pntnpuzl.c @@ -381,8 +381,8 @@ static DRIVER_INIT(pip) // rom[0x2696/2] = 0x4e71; // rom[0x26a0/2] = 0x4e71; pc_vga_init(machine, vga_setting, NULL); - pc_vga_io_init(machine, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000); - + pc_vga_io_init(machine, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000); + } GAME( 199?, pntnpuzl, 0, pntnpuzl, pntnpuzl, pip, ROT90, "Century?", "Paint & Puzzle",GAME_NO_SOUND|GAME_NOT_WORKING ) diff --git a/src/mame/drivers/popobear.c b/src/mame/drivers/popobear.c index 1b92b973d96..4e84449ffd0 100644 --- a/src/mame/drivers/popobear.c +++ b/src/mame/drivers/popobear.c @@ -2,19 +2,19 @@ (c) 2000 - Bao Ma Technology Co., LTD |-----------------------------------------| -| DIP2 DIP4 UM3567(YM2413) |J -| DIP1 DIP3 |A +| DIP2 DIP4 UM3567(YM2413) |J +| DIP1 DIP3 |A | TA-A-901 |M -| EN-A-701 EN-A-801 U6295(OKI) |M +| EN-A-701 EN-A-801 U6295(OKI) |M | EN-A-501 EN-A-601 |A | EN-A-301 EN-A-401 | | |C | AIA90610 |O | BMC-68pin AIA90423 |N -| plcc (68k) BMC-160pin |N -| |E +| plcc (68k) BMC-160pin |N +| |E | OSC |C -| 42.000 |T +| 42.000 |T |-----------------------------------------| 1 - BMC AIA90423 - 160-Pin ASIC, FGPA, Video? @@ -111,7 +111,7 @@ static WRITE16_HANDLER( popo_620000_w ) { } static ADDRESS_MAP_START( popobear_mem, AS_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x210000, 0x21ffff) AM_RAM - AM_RANGE(0x3E0000, 0x3EFFFF) AM_RAM AM_BASE_MEMBER(popobear_state, popobear_vram) + AM_RANGE(0x3E0000, 0x3EFFFF) AM_RAM AM_BASE_MEMBER(popobear_state, popobear_vram) /* Blitter stuff? */ AM_RANGE(0x480000, 0x480001) AM_READ(popo_480001_r) AM_WRITE(popo_480001_w) @@ -125,7 +125,7 @@ static ADDRESS_MAP_START( popobear_mem, AS_PROGRAM, 16 ) AM_RANGE(0x48003a, 0x48003b) AM_READ(popo_48003a_r) AM_WRITE(popo_48003a_w) AM_RANGE(0x480400, 0x48041f) AM_RAM AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // looks palette like at least - + /* I/O maybe? */ AM_RANGE(0x500000, 0x500001) AM_READ(popo_500000_r) AM_RANGE(0x520000, 0x520001) AM_READ(popo_520000_r) @@ -315,7 +315,7 @@ static TIMER_DEVICE_CALLBACK( popobear_irq ) static MACHINE_CONFIG_START( popobear, popobear_state ) MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz/4) // XTAL CORRECT, DIVISOR GUESSED - MCFG_CPU_PROGRAM_MAP(popobear_mem) + MCFG_CPU_PROGRAM_MAP(popobear_mem) // levels 2,3,5 look interesting //MCFG_CPU_VBLANK_INT("screen",irq3_line_hold) MCFG_TIMER_ADD_SCANLINE("scantimer", popobear_irq, "screen", 0, 1) diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c index 5cf58fa7023..cb09ea3ad2c 100644 --- a/src/mame/drivers/rocnrope.c +++ b/src/mame/drivers/rocnrope.c @@ -121,7 +121,7 @@ static INPUT_PORTS_START( rocnrope ) PORT_START("DSW3") PORT_DIPNAME( 0x07, 0x06, "First Bonus" ) PORT_DIPLOCATION("SW3:1,2,3") -// PORT_DIPSETTING( 0x07, "20000" ) // unused +// PORT_DIPSETTING( 0x07, "20000" ) // unused PORT_DIPSETTING( 0x06, "20000" ) PORT_DIPSETTING( 0x05, "30000" ) PORT_DIPSETTING( 0x04, "40000" ) diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c index a0ba6b1e85f..96b649c8641 100644 --- a/src/mame/drivers/sliver.c +++ b/src/mame/drivers/sliver.c @@ -107,7 +107,7 @@ public: static void plot_pixel_rgb(sliver_state *state, int x, int y, UINT32 r, UINT32 g, UINT32 b) { -// printf("plot %d %d %d\n", r,g,b); +// printf("plot %d %d %d\n", r,g,b); if (y < 0 || x < 0 || x > 383 || y > 255) return; @@ -228,7 +228,7 @@ static void render_jpeg(running_machine &machine) struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; - JSAMPARRAY buffer; + JSAMPARRAY buffer; cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); @@ -239,7 +239,7 @@ static void render_jpeg(running_machine &machine) jpeg_start_decompress(&cinfo); int row_stride = cinfo.output_width * cinfo.output_components; - + buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); while (cinfo.output_scanline < cinfo.output_height) @@ -253,7 +253,7 @@ static void render_jpeg(running_machine &machine) UINT8 g = buffer[0][(x*3)+1]; UINT8 r = buffer[0][(x*3)+2]; plot_pixel_rgb(state, x - x_offset + state->m_jpeg_x, y - y_offset - state->m_jpeg_y, r, g, b); - + } } diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index de5e9cd41a5..8645738f245 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -713,7 +713,7 @@ static DRIVER_INIT( taitowlf ) kbdc8042_init(machine, &at8042); #if ENABLE_VGA pc_vga_init(machine, vga_setting, NULL); - pc_vga_io_init(machine, machine.device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine.device("maincpu")->memory().space(AS_IO), 0x0000); + pc_vga_io_init(machine, machine.device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine.device("maincpu")->memory().space(AS_IO), 0x0000); #endif } diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c index 8cd43dc1398..012e5054c50 100644 --- a/src/mame/drivers/twincobr.c +++ b/src/mame/drivers/twincobr.c @@ -6,8 +6,8 @@ Flying Shark details: Carl-Henrik Skarstedt & Magnus Danielsson Flying Shark bootleg info: Ruben Panossian - Both bootlegs, while sharing a lot of code with the original sets - are probably based off undumped versions. + Both bootlegs, while sharing a lot of code with the original sets + are probably based off undumped versions. Supported games: diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h index 93663ef3034..8379ebbea1c 100644 --- a/src/mame/includes/metro.h +++ b/src/mame/includes/metro.h @@ -54,7 +54,7 @@ public: int m_has_zoom; int m_sprite_xoffs; int m_sprite_yoffs; - + UINT8 * m_expanded_gfx1; /* blitter */ diff --git a/src/mame/machine/steppers.c b/src/mame/machine/steppers.c index e64db4286ef..ef14ff8fd6b 100644 --- a/src/mame/machine/steppers.c +++ b/src/mame/machine/steppers.c @@ -62,7 +62,7 @@ const stepper_interface starpoint_interface_48step = STARPOINT_48STEP_REEL, 16, 24, - 0x09,//Starpoint tech specs say that the only coil pattern guaranteed to line up the opto is this one + 0x09,//Starpoint tech specs say that the only coil pattern guaranteed to line up the opto is this one 0 }; @@ -90,7 +90,7 @@ void stepper_config(running_machine &machine, int which, const stepper_interface step[which].index_patt = intf->index_patt; /* hex value of coil pattern (0 if not needed)*/ step[which].reverse = intf->reverse; - + step[which].phase = 0; step[which].pattern = 0; step[which].old_pattern = 0; @@ -108,7 +108,7 @@ void stepper_config(running_machine &machine, int which, const stepper_interface //Dice reels are 48 step motors, but complete three full cycles between opto updates step[which].max_steps = ((48*3)*2); break; - + } state_save_register_item(machine, "stepper", NULL, which, step[which].index_start); @@ -209,21 +209,21 @@ int stepper_update(int which, UINT8 pattern) int changed = 0; /* This code probably makes more sense if you visualise what is being emulated, namely - a spinning drum with two electromagnets inside. Essentially, the CPU - activates a pair of windings on these magnets leads as necessary to attract and repel the drum to pull it round and - display as appropriate. To attempt to visualise the rotation effect, take a look at the compass rose below, representing a side on view of the reel, - the numbers indicate the phase information as used - - 7 - N - 1 W E 5 - S - 3 - - For sake of accuracy, we're representing all possible phases of the motor, effectively moving the motor one half step at a time, so a 48 step motor becomes - 96 half steps. This is necessary because of some programs running the wiring in series with a distinct delay between the pair being completed. This causes - a small movement that may trigger the optic tab. - */ + a spinning drum with two electromagnets inside. Essentially, the CPU + activates a pair of windings on these magnets leads as necessary to attract and repel the drum to pull it round and + display as appropriate. To attempt to visualise the rotation effect, take a look at the compass rose below, representing a side on view of the reel, + the numbers indicate the phase information as used + + 7 + N + 1 W E 5 + S + 3 + + For sake of accuracy, we're representing all possible phases of the motor, effectively moving the motor one half step at a time, so a 48 step motor becomes + 96 half steps. This is necessary because of some programs running the wiring in series with a distinct delay between the pair being completed. This causes + a small movement that may trigger the optic tab. + */ int pos,steps=0; step[which].pattern = pattern; @@ -288,7 +288,7 @@ int stepper_update(int which, UINT8 pattern) break; } break; - + case BARCREST_48STEP_REEL : //Standard drive table is 1,3,2,6,4,C,8,9 //this runs through the stator patterns in such a way as to drive the reel forward (downwards from the player's view) @@ -321,7 +321,7 @@ int stepper_update(int which, UINT8 pattern) break; // The below values should not be used by anything sane, as they effectively ignore one stator side entirely - // Yellow Black Orange Brown + // Yellow Black Orange Brown case 0x05:// 0 1 0 1 { if ((step[which].old_phase ==6)||(step[which].old_phase == 0)) // if the previous pattern had the drum in the northern quadrant, it will point north now @@ -334,7 +334,7 @@ int stepper_update(int which, UINT8 pattern) } } break; - + case 0x0A:// 1 0 1 0 { if ((step[which].old_phase ==6)||(step[which].old_phase == 4)) // if the previous pattern had the drum in the eastern quadrant, it will point east now @@ -347,14 +347,14 @@ int stepper_update(int which, UINT8 pattern) } } break; - } + } break; - + case MPU3_48STEP_REEL : /* The MPU3 interface is actually the same as the MPU4 setup, but with two active lines instead of four - Inverters are used so if a pin is low, the higher bit of the pair is activated, and if high the lower bit is activated. - TODO:Check this, 2 and 1 could be switched over. - */ + Inverters are used so if a pin is low, the higher bit of the pair is activated, and if high the lower bit is activated. + TODO:Check this, 2 and 1 could be switched over. + */ switch (pattern) { // Yellow(2) Black(1) Orange(!2) Brown(!1) @@ -375,7 +375,7 @@ int stepper_update(int which, UINT8 pattern) } steps = step[which].old_phase - step[which].phase; - + if (steps < -4) { steps = steps +8; @@ -384,7 +384,7 @@ int stepper_update(int which, UINT8 pattern) { steps = steps -8; } - + step[which].old_phase = step[which].phase; step[which].old_pattern = step[which].pattern; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index f589b600655..41ff0bba4f1 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -11250,6 +11250,13 @@ fcockt_9 // (c) 2003 fcockt_10 // (c) 2003 fcockt_11 // (c) 2003 fcockt_12 // (c) 2003 +fcockt2_3 +fcockt2_4 +fcockt2_4a +fcockt2_4b +fcockt2_4d +fcockt2_4f +fcockt2_5 // Lucky Haunter //lhaunt // (c) 2003 @@ -16827,6 +16834,7 @@ m1coro22n m1coro21n m1coro21np m1coro12n +m1coro12np m1coro11n m1coro11np m1coro31 diff --git a/src/mame/video/boogwing.c b/src/mame/video/boogwing.c index 919b7c92ffc..9aca459d17e 100644 --- a/src/mame/video/boogwing.c +++ b/src/mame/video/boogwing.c @@ -194,8 +194,8 @@ SCREEN_UPDATE_RGB32( boogwing ) draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 3); draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 4); -// screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x500, 0x1ff); -// screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x700, 0xff); +// screen.machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x500, 0x1ff); +// screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x700, 0xff); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/dassault.c b/src/mame/video/dassault.c index 140123d069a..c552fc58a22 100644 --- a/src/mame/video/dassault.c +++ b/src/mame/video/dassault.c @@ -49,11 +49,11 @@ static void mixdassaultlayer(running_machine &machine, bitmap_rgb32 &bitmap, bit if (pix&0xf) { - UINT16 pen = pix&0x1ff; + UINT16 pen = pix&0x1ff; if (pix & 0x800) pen += 0x200; - + if (alpha!=0xff) - { + { if (pix&0x600) { UINT32 base = dstline[x]; @@ -131,7 +131,7 @@ SCREEN_UPDATE_RGB32( dassault ) { /* Unused */ } - + deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c index d60b8fadc53..e5b06599483 100644 --- a/src/mame/video/decospr.c +++ b/src/mame/video/decospr.c @@ -34,7 +34,7 @@ dassault.c to convert: - + boogwing.c - complex video mixing notes: diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c index 513408df229..d2840a74b3d 100644 --- a/src/mame/video/f1gp.c +++ b/src/mame/video/f1gp.c @@ -359,7 +359,7 @@ SCREEN_UPDATE_IND16( f1gpb ) screen.machine().priority_bitmap.fill(0, cliprect); - state->m_roz_tilemap->draw_roz(bitmap, cliprect, + state->m_roz_tilemap->draw_roz(bitmap, cliprect, startx << 13, starty << 13, incxx << 5, incxy << 5, incyx << 5, incyy << 5, 1, 0, 0); diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c index d29698d8339..834f1dcb775 100644 --- a/src/mame/video/konicdev.c +++ b/src/mame/video/konicdev.c @@ -9738,7 +9738,7 @@ void k001604_draw_back_layer( device_t *device, bitmap_rgb32 &bitmap, const rect if ((k001604->reg[0x6c / 4] & (0x08 >> layer)) != 0) { - k001604->layer_roz[layer]->draw_roz(bitmap, cliprect, + k001604->layer_roz[layer]->draw_roz(bitmap, cliprect, x << 5, y << 5, xx << 5, xy << 5, yx << 5, yy << 5, 1, 0, 0); } } diff --git a/src/mame/video/macrossp.c b/src/mame/video/macrossp.c index b40eb0bdac0..e1dc1c5ffaa 100644 --- a/src/mame/video/macrossp.c +++ b/src/mame/video/macrossp.c @@ -358,7 +358,7 @@ static void draw_layer( running_machine &machine, bitmap_rgb32 &bitmap, const re startx -= (368/2) * inc; starty -= (240/2) * inc; - tm->draw_roz(bitmap, cliprect, + tm->draw_roz(bitmap, cliprect, startx,starty,inc,0,0,inc, 1, /* wraparound */ 0,0); diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c index ba76e2142a6..d1f7f4f18ea 100644 --- a/src/mame/video/mermaid.c +++ b/src/mame/video/mermaid.c @@ -501,7 +501,7 @@ SCREEN_VBLANK( mermaid ) rect.max_y = sy + screen.machine().gfx[1]->height - 1; rect &= visarea; - + // check collision sprite - sprite state->m_helper.fill(0, rect); diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c index b06fc5d1bc4..3b4fb1ca319 100644 --- a/src/mame/video/ms32.c +++ b/src/mame/video/ms32.c @@ -315,7 +315,7 @@ static void draw_roz(running_machine &machine, bitmap_ind16 &bitmap, const recta if (incxx & 0x10000) incxx |= ~0x1ffff; if (incxy & 0x10000) incxy |= ~0x1ffff; - state->m_roz_tilemap->draw_roz(bitmap, my_clip, + state->m_roz_tilemap->draw_roz(bitmap, my_clip, (start2x+startx+offsx)<<16, (start2y+starty+offsy)<<16, incxx<<8, incxy<<8, 0, 0, 1, // Wrap @@ -346,7 +346,7 @@ static void draw_roz(running_machine &machine, bitmap_ind16 &bitmap, const recta if (incyy & 0x10000) incyy |= ~0x1ffff; if (incyx & 0x10000) incyx |= ~0x1ffff; - state->m_roz_tilemap->draw_roz(bitmap, cliprect, + state->m_roz_tilemap->draw_roz(bitmap, cliprect, (startx+offsx)<<16, (starty+offsy)<<16, incxx<<8, incxy<<8, incyx<<8, incyy<<8, 1, // Wrap diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c index e288d56e6cf..e205b57a1ef 100644 --- a/src/mame/video/namcona1.c +++ b/src/mame/video/namcona1.c @@ -621,7 +621,7 @@ static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, cons int dy = -8; /* vertical adjust */ UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy; UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy; - state->m_roz_tilemap->draw_roz(bitmap, clip, + state->m_roz_tilemap->draw_roz(bitmap, clip, startx, starty, incxx, incxy, incyx, incyy, 0, 0, primask, 0); } else diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c index ce33223f34f..97f3134491a 100644 --- a/src/mame/video/namcos2.c +++ b/src/mame/video/namcos2.c @@ -236,7 +236,7 @@ DrawRozHelper( else { tmap->draw_roz( - bitmap, clip, + bitmap, clip, rozInfo->startx, rozInfo->starty, rozInfo->incxx, rozInfo->incxy, rozInfo->incyx, rozInfo->incyy, diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c index 0c4eca39c76..ff69e11bc78 100644 --- a/src/mame/video/ppu2c0x.c +++ b/src/mame/video/ppu2c0x.c @@ -87,7 +87,7 @@ const device_type PPU_2C05_04 = &device_creator<ppu2c05_04_device>; static ADDRESS_MAP_START( ppu2c0x, AS_0, 8, ppu2c0x_device ) AM_RANGE(0x0000, 0x3eff) AM_RAM AM_RANGE(0x3f00, 0x3fff) AM_READWRITE(palette_read, palette_write) -// AM_RANGE(0x0000, 0x3fff) AM_RAM +// AM_RANGE(0x0000, 0x3fff) AM_RAM ADDRESS_MAP_END //------------------------------------------------- @@ -109,7 +109,7 @@ void ppu2c0x_device::device_config_complete() { const ppu2c0x_interface *config = reinterpret_cast<const ppu2c0x_interface *>(static_config()); assert(config); - + /* reset the callbacks */ m_latch = NULL; m_scanline_callback_proc = NULL; @@ -143,11 +143,11 @@ ppu2c0x_device::ppu2c0x_device(const machine_config &mconfig, device_type type, { for (int i = 0; i < PPU_MAX_REG; i++) m_regs[i] = 0; - + memset(m_palette_ram, 0, ARRAY_LENGTH(m_palette_ram)); - + m_scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME; - + /* usually, no security value... */ m_security_value = 0; } @@ -207,12 +207,12 @@ void ppu2c0x_device::device_start() m_cpu = machine().device<cpu_device>( m_cpu_tag ); assert(m_screen && m_cpu); - + // allocate timers m_hblank_timer = timer_alloc(TIMER_HBLANK); m_nmi_timer = timer_alloc(TIMER_NMI); m_scanline_timer = timer_alloc(TIMER_SCANLINE); - + /* initialize the scanline handling portion */ m_scanline_timer->adjust(m_screen->time_until_pos(1)); m_hblank_timer->adjust(m_cpu->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation @@ -229,7 +229,7 @@ void ppu2c0x_device::device_start() { /* monochromatic table */ m_colortable_mono[i] = default_colortable_mono[i] + m_color_base; - + /* color table */ m_colortable[i] = default_colortable[i] + m_color_base; } @@ -468,47 +468,47 @@ void ppu2c0x_device::device_timer(emu_timer &timer, device_timer_id id, int para case TIMER_HBLANK: blanked = (m_regs[PPU_CONTROL1] & (PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES)) == 0; vblank = ((m_scanline >= PPU_VBLANK_FIRST_SCANLINE - 1) && (m_scanline < m_scanlines_per_frame - 1)) ? 1 : 0; - + //update_scanline(); - + if (m_hblank_callback_proc) (*m_hblank_callback_proc) (this, m_scanline, vblank, blanked); - + m_hblank_timer->adjust(attotime::never); break; - - case TIMER_NMI: + + case TIMER_NMI: // Actually fire the VMI if (m_nmi_callback_proc) (*m_nmi_callback_proc) (this, regs); - + m_nmi_timer->adjust(attotime::never); break; - + case TIMER_SCANLINE: blanked = (m_regs[PPU_CONTROL1] & (PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES)) == 0; vblank = ((m_scanline >= PPU_VBLANK_FIRST_SCANLINE - 1) && (m_scanline < m_scanlines_per_frame - 1)) ? 1 : 0; int next_scanline; - + /* if a callback is available, call it */ if (m_scanline_callback_proc) (*m_scanline_callback_proc)(this, m_scanline, vblank, blanked); - + /* update the scanline that just went by */ update_scanline(); - + /* increment our scanline count */ m_scanline++; - + // logerror("starting scanline %d (MAME %d, beam %d)\n", m_scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos()); - + /* Note: this is called at the _end_ of each scanline */ if (m_scanline == PPU_VBLANK_FIRST_SCANLINE) { // logerror("vblank starting\n"); /* We just entered VBLANK */ m_regs[PPU_STATUS] |= PPU_STATUS_VBLANK; - + /* If NMI's are set to be triggered, go for it */ if (m_regs[PPU_CONTROL0] & PPU_CONTROL0_NMI) { @@ -519,33 +519,33 @@ void ppu2c0x_device::device_timer(emu_timer &timer, device_timer_id id, int para m_nmi_timer->adjust(m_cpu->cycles_to_attotime(4)); } } - + if (m_scanline == m_scanlines_per_frame - 1) { // logerror("vblank ending\n"); /* clear the vblank & sprite hit flag */ m_regs[PPU_STATUS] &= ~(PPU_STATUS_VBLANK | PPU_STATUS_SPRITE0_HIT | PPU_STATUS_8SPRITES); } - + /* see if we rolled */ else if (m_scanline == m_scanlines_per_frame) { /* if background or sprites are enabled, copy the ppu address latch */ if (!blanked) m_refresh_data = m_refresh_latch; - + /* reset the scanline count */ m_scanline = 0; //logerror("sprite 0 x: %d y: %d num: %d\n", m_spriteram[3], m_spriteram[0] + 1, m_spriteram[1]); } - + next_scanline = m_scanline + 1; if (next_scanline == m_scanlines_per_frame) next_scanline = 0; - + // Call us back when the hblank starts for this scanline m_hblank_timer->adjust(m_cpu->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation - + // trigger again at the start of the next scanline m_scanline_timer->adjust(m_screen->time_until_pos(next_scanline * m_scan_scale)); break; @@ -1043,7 +1043,7 @@ READ8_MEMBER( ppu2c0x_device::palette_read ) { if (m_regs[PPU_CONTROL1] & PPU_CONTROL1_DISPLAY_MONO) return (m_palette_ram[offset & 0x1f] & 0x30); - + else return (m_palette_ram[offset & 0x1f]); } diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h index 304384a1cb1..ba90caa2a65 100644 --- a/src/mame/video/ppu2c0x.h +++ b/src/mame/video/ppu2c0x.h @@ -144,7 +144,7 @@ class ppu2c0x_device : public device_t, public: // construction/destruction ppu2c0x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); - + DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( palette_read ); @@ -157,12 +157,12 @@ public: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; // address space configurations const address_space_config m_space_config; - - + + /* routines */ void init_palette( running_machine &machine, int first_entry ); void init_palette_rgb( running_machine &machine, int first_entry ); - + void draw_background( UINT8 *line_priority ); void draw_sprites( UINT8 *line_priority ); void render_scanline(); @@ -179,15 +179,15 @@ public: void set_hblank_callback( ppu2c0x_scanline_cb cb ) { if (cb != NULL) m_hblank_callback_proc = cb; }; void set_vidaccess_callback( ppu2c0x_vidaccess_cb cb ) { if (cb != NULL) m_vidaccess_callback_proc = cb; }; void set_scanlines_per_frame( int scanlines ) { m_scanlines_per_frame = scanlines; }; - + //27/12/2002 (HACK!) void set_latch( void (*ppu_latch_t)( device_t *device, offs_t offset ) ); - - // void update_screen(bitmap_t &bitmap, const rectangle &cliprect); - + + // void update_screen(bitmap_t &bitmap, const rectangle &cliprect); + cpu_device *m_cpu; screen_device *m_screen; - bitmap_ind16 *m_bitmap; /* target bitmap */ + bitmap_ind16 *m_bitmap; /* target bitmap */ UINT8 *m_spriteram; /* sprite ram */ pen_t *m_colortable; /* color table modified at run time */ pen_t *m_colortable_mono; /* monochromatic color table modified at run time */ @@ -214,7 +214,7 @@ public: int m_scanlines_per_frame; /* number of scanlines per frame */ int m_security_value; /* 2C05 protection */ void (*m_latch)( device_t *device, offs_t offset ); - + // timers emu_timer *m_hblank_timer; /* hblank period at end of each scanline */ emu_timer *m_nmi_timer; /* NMI timer */ diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c index 698d1993c7e..03fe5f48c0a 100644 --- a/src/mame/video/psikyo.c +++ b/src/mame/video/psikyo.c @@ -637,7 +637,7 @@ SCREEN_UPDATE_IND16( psikyo ) x0 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x000/2 + i)]; } - + tmptilemap0->set_scrollx( (i + layer0_scrolly) % tilemap_width(tm0size), layer0_scrollx + x0 ); @@ -654,7 +654,7 @@ SCREEN_UPDATE_IND16( psikyo ) x1 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x200/2 + i)]; } - + tmptilemap1->set_scrollx( (i + layer1_scrolly) % tilemap_width(tm1size), layer1_scrollx + x1 ); @@ -811,7 +811,7 @@ SCREEN_UPDATE_IND16( psikyo_bootleg ) x0 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x000/2 + i)]; } - + tmptilemap0->set_scrollx( (i + layer0_scrolly) % tilemap_width(tm0size), layer0_scrollx + x0 ); @@ -828,7 +828,7 @@ SCREEN_UPDATE_IND16( psikyo_bootleg ) x1 = ((UINT16 *)state->m_vregs)[BYTE_XOR_BE(0x200/2 + i)]; } - + tmptilemap1->set_scrollx( (i + layer1_scrolly) % tilemap_width(tm1size), layer1_scrollx + x1 ); diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c index 426e6e68749..c1b8386d4f4 100644 --- a/src/mame/video/punchout.c +++ b/src/mame/video/punchout.c @@ -240,7 +240,7 @@ static void draw_big_sprite(running_machine &machine, bitmap_ind16 &bitmap, cons state->m_spr1_tilemap->set_palette_offset(0x100 * palette); - state->m_spr1_tilemap->draw_roz(bitmap, cliprect, + state->m_spr1_tilemap->draw_roz(bitmap, cliprect, startx,starty + 0x200*(2) * zoom, incxx,0,0,incyy, /* zoom, no rotation */ 0, /* no wraparound */ @@ -288,7 +288,7 @@ static void armwrest_draw_big_sprite(running_machine &machine, bitmap_ind16 &bit _tilemap->set_palette_offset(0x100 * palette); - _tilemap->draw_roz(bitmap, cliprect, + _tilemap->draw_roz(bitmap, cliprect, startx,starty + 0x200*(2) * zoom, incxx,0,0,incyy, /* zoom, no rotation */ 0, /* no wraparound */ @@ -321,7 +321,7 @@ static void drawbs2(running_machine &machine, bitmap_ind16 &bitmap, const rectan incxx = 1; // this tilemap doesn't actually zoom, but draw_roz is the only way to draw it without wraparound - state->m_spr2_tilemap->draw_roz(bitmap, cliprect, + state->m_spr2_tilemap->draw_roz(bitmap, cliprect, sx, sy, incxx << 16, 0, 0, 1 << 16, 0, 0, 0); } diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c index e446c207c5a..b6a637f9a45 100644 --- a/src/mame/video/rohga.c +++ b/src/mame/video/rohga.c @@ -153,12 +153,12 @@ static void mixwizdfirelayer(running_machine &machine, bitmap_rgb32 &bitmap, con if (pix&0xf) { UINT16 pen = pix&0x1ff; - + if (pen&0x100) - { + { UINT32 base = dstline[x]; pen &=0xff; - dstline[x] = alpha_blend_r32(base, paldata[pen+penbase], 0x80); + dstline[x] = alpha_blend_r32(base, paldata[pen+penbase], 0x80); } else { diff --git a/src/mame/video/simpl156.c b/src/mame/video/simpl156.c index c70b1a8170b..c4c605010d5 100644 --- a/src/mame/video/simpl156.c +++ b/src/mame/video/simpl156.c @@ -17,7 +17,7 @@ VIDEO_START( simpl156 ) state->m_pf2_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2); state->m_spriteram = auto_alloc_array_clear(machine, UINT16, 0x2000/2); machine.generic.paletteram.u16 = auto_alloc_array_clear(machine, UINT16, 0x1000/2); - + memset(state->m_spriteram, 0xff, 0x2000); /* and register the allocated ram so that save states still work */ diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c index 75e7f342357..4bcd8eab764 100644 --- a/src/mame/video/skyraid.c +++ b/src/mame/video/skyraid.c @@ -141,7 +141,7 @@ SCREEN_UPDATE_IND16( skyraid ) rectangle helper_clip = cliprect; helper_clip &= state->m_helper.cliprect(); - + draw_terrain(screen.machine(), state->m_helper, helper_clip); draw_sprites(screen.machine(), state->m_helper, helper_clip); draw_missiles(screen.machine(), state->m_helper, helper_clip); diff --git a/src/tools/chdman.c b/src/tools/chdman.c index 17c02b5cad0..ca473ef699f 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -3410,7 +3410,7 @@ int CLIB_DECL main(int argc, char *argv[]) { "-createuncomphd", do_createhd_uncomp, 0 }, { "-createraw", do_createraw, 0 }, { "-createcd", do_createcd, 0 }, -// { "-createcdflac", do_createcd, 1 }, +// { "-createcdflac", do_createcd, 1 }, { "-createblankhd", do_createblankhd, 0 }, { "-createav", do_createav, 0 }, { "-copydata", do_copydata, 0 }, diff --git a/src/version.c b/src/version.c index a69ad847dd9..c709160d782 100644 --- a/src/version.c +++ b/src/version.c @@ -38,4 +38,4 @@ ***************************************************************************/ extern const char build_version[]; -const char build_version[] = "0.144u6 ("__DATE__")"; +const char build_version[] = "0.144u7 ("__DATE__")"; |