Previous 15994 Revisions Next

r15076 Tuesday 1st May, 2012 at 00:14:56 UTC by R. Belmont
Various Clang warning cleanups (and a few actual bugfixes) [Balrog]
[src/emu/cpu/i386]i386op16.c i386op32.c i386ops.c
[src/emu/cpu/m68000]m68kcpu.h
[src/emu/machine]eeprom.c
[src/emu/sound]pokey.c tms5220.c
[src/lib/formats]apridisk.c coco_dsk.c ioprocs.c
[src/lib/lib7z]LzmaEnc.c
[src/lib/libflac/libflac]md5.c
[src/lib/util]un7z.c
[src/osd/sdl]debugosx.m

src/osd/sdl/debugosx.m
r15075r15076
827827   {
828828      NSInteger tag;
829829      for (tag = 1; tag <= 8; tag <<= 1) {
830         NSString   *title = [NSString stringWithFormat:@"%d-byte Chunks", tag];
830         NSString   *title = [NSString stringWithFormat:@"%ld-byte Chunks", tag];
831831         NSMenuItem   *chunkItem = [menu insertItemWithTitle:title
832832                                          action:@selector(showChunkSize:)
833                                     keyEquivalent:[NSString stringWithFormat:@"%d", tag]
833                                     keyEquivalent:[NSString stringWithFormat:@"%ld", tag]
834834                                          atIndex:index++];
835835         [chunkItem setTarget:self];
836836         [chunkItem setTag:tag];
r15075r15076
900900
901901   item = [contextMenu addItemWithTitle:@"Toggle Breakpoint"
902902                          action:@selector(debugToggleBreakpoint:)
903                     keyEquivalent:[NSString stringWithFormat:@"%C", NSF9FunctionKey]];
903                     keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]];
904904   [item setKeyEquivalentModifierMask:0];
905905   [item setTarget:self];
906906
907907   item = [contextMenu addItemWithTitle:@"Disable Breakpoint"
908908                          action:@selector(debugToggleBreakpointEnable:)
909                     keyEquivalent:[NSString stringWithFormat:@"%C", NSF9FunctionKey]];
909                     keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]];
910910   [item setKeyEquivalentModifierMask:NSShiftKeyMask];
911911   [item setTarget:self];
912912
r15075r15076
914914
915915   item = [contextMenu addItemWithTitle:@"Run to Cursor"
916916                          action:@selector(debugRunToCursor:)
917                     keyEquivalent:[NSString stringWithFormat:@"%C", NSF4FunctionKey]];
917                     keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF4FunctionKey]];
918918   [item setKeyEquivalentModifierMask:0];
919919   [item setTarget:self];
920920
r15075r15076
11631163   {
11641164      NSMenuItem *breakItem = [menu insertItemWithTitle:@"Toggle Breakpoint at Cursor"
11651165                                       action:@selector(debugToggleBreakpoint:)
1166                                 keyEquivalent:[NSString stringWithFormat:@"%C", NSF9FunctionKey]
1166                                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]
11671167                                      atIndex:index++];
11681168      [breakItem setKeyEquivalentModifierMask:0];
11691169      [breakItem setTarget:self];
r15075r15076
11711171   {
11721172      NSMenuItem *disableItem = [menu insertItemWithTitle:@"Disable Breakpoint at Cursor"
11731173                                        action:@selector(debugToggleBreakpointEnable:)
1174                                   keyEquivalent:[NSString stringWithFormat:@"%C", NSF9FunctionKey]
1174                                   keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]
11751175                                       atIndex:index++];
11761176      [disableItem setKeyEquivalentModifierMask:NSShiftKeyMask];
11771177      [disableItem setAlternate:YES];
r15075r15076
11831183      if (runMenu != nil) {
11841184         runItem = [runMenu addItemWithTitle:@"to Cursor"
11851185                               action:@selector(debugRunToCursor:)
1186                          keyEquivalent:[NSString stringWithFormat:@"%C", NSF4FunctionKey]];
1186                          keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF4FunctionKey]];
11871187      } else {
11881188         runItem = [menu insertItemWithTitle:@"Run to Cursor"
11891189                               action:@selector(debugRunToCursor:)
1190                          keyEquivalent:[NSString stringWithFormat:@"%C", NSF4FunctionKey]
1190                          keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF4FunctionKey]
11911191                              atIndex:index++];
11921192      }
11931193      [runItem setKeyEquivalentModifierMask:0];
r15075r15076
13501350   {
13511351      NSMenuItem *runParentItem = [menu addItemWithTitle:@"Run"
13521352                                       action:@selector(debugRun:)
1353                                  keyEquivalent:[NSString stringWithFormat:@"%C", NSF5FunctionKey]];
1353                                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF5FunctionKey]];
13541354      NSMenu *runMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Run"];
13551355      [runParentItem setSubmenu:runMenu];
13561356      [runMenu release];
13571357      [runParentItem setKeyEquivalentModifierMask:0];
13581358      [[runMenu addItemWithTitle:@"and Hide Debugger"
13591359                     action:@selector(debugRunAndHide:)
1360                keyEquivalent:[NSString stringWithFormat:@"%C", NSF12FunctionKey]]
1360                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF12FunctionKey]]
13611361       setKeyEquivalentModifierMask:0];
13621362      [[runMenu addItemWithTitle:@"to Next CPU"
13631363                     action:@selector(debugRunToNextCPU:)
1364                keyEquivalent:[NSString stringWithFormat:@"%C", NSF6FunctionKey]]
1364                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF6FunctionKey]]
13651365       setKeyEquivalentModifierMask:0];
13661366      [[runMenu addItemWithTitle:@"until Next Interrupt on Current CPU"
13671367                     action:@selector(debugRunToNextInterrupt:)
1368                keyEquivalent:[NSString stringWithFormat:@"%C", NSF7FunctionKey]]
1368                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF7FunctionKey]]
13691369       setKeyEquivalentModifierMask:0];
13701370      [[runMenu addItemWithTitle:@"until Next VBLANK"
13711371                     action:@selector(debugRunToNextVBLANK:)
1372                keyEquivalent:[NSString stringWithFormat:@"%C", NSF8FunctionKey]]
1372                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF8FunctionKey]]
13731373       setKeyEquivalentModifierMask:0];
13741374   }
13751375   {
r15075r15076
13791379      [stepMenu release];
13801380      [[stepMenu addItemWithTitle:@"Into"
13811381                      action:@selector(debugStepInto:)
1382                 keyEquivalent:[NSString stringWithFormat:@"%C", NSF11FunctionKey]]
1382                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF11FunctionKey]]
13831383       setKeyEquivalentModifierMask:0];
13841384      [[stepMenu addItemWithTitle:@"Over"
13851385                      action:@selector(debugStepOver:)
1386                 keyEquivalent:[NSString stringWithFormat:@"%C", NSF10FunctionKey]]
1386                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
13871387       setKeyEquivalentModifierMask:0];
13881388      [[stepMenu addItemWithTitle:@"Out"
13891389                      action:@selector(debugStepOut:)
1390                 keyEquivalent:[NSString stringWithFormat:@"%C", NSF10FunctionKey]]
1390                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
13911391       setKeyEquivalentModifierMask:NSShiftKeyMask];
13921392   }
13931393   {
r15075r15076
13971397      [resetMenu release];
13981398      [[resetMenu addItemWithTitle:@"Soft"
13991399                       action:@selector(debugSoftReset:)
1400                  keyEquivalent:[NSString stringWithFormat:@"%C", NSF3FunctionKey]]
1400                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
14011401       setKeyEquivalentModifierMask:0];
14021402      [[resetMenu addItemWithTitle:@"Hard"
14031403                       action:@selector(debugHardReset:)
1404                  keyEquivalent:[NSString stringWithFormat:@"%C", NSF3FunctionKey]]
1404                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
14051405       setKeyEquivalentModifierMask:NSShiftKeyMask];
14061406   }
14071407   [menu addItem:[NSMenuItem separatorItem]];
src/emu/cpu/m68000/m68kcpu.h
r15075r15076
15801580/* Format 8 stack frame (68010).
15811581 * 68010 only.  This is the 29 word bus/address error frame.
15821582 */
1583void m68ki_stack_frame_1000(m68ki_cpu_core *m68k, UINT32 pc, UINT32 sr, UINT32 vector)
1583INLINE void m68ki_stack_frame_1000(m68ki_cpu_core *m68k, UINT32 pc, UINT32 sr, UINT32 vector)
15841584{
15851585   /* VERSION
15861586     * NUMBER
r15075r15076
16341634 * if the error happens at an instruction boundary.
16351635 * PC stacked is address of next instruction.
16361636 */
1637void m68ki_stack_frame_1010(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address)
1637INLINE void m68ki_stack_frame_1010(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address)
16381638{
16391639   int orig_rw = m68k->mmu_tmp_buserror_rw;   // this gets splatted by the following pushes, so save it now
16401640   int orig_fc = m68k->mmu_tmp_buserror_fc;
r15075r15076
16861686 * if the error happens during instruction execution.
16871687 * PC stacked is address of instruction in progress.
16881688 */
1689void m68ki_stack_frame_1011(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address)
1689INLINE void m68ki_stack_frame_1011(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address)
16901690{
16911691   int orig_rw = m68k->mmu_tmp_buserror_rw;   // this gets splatted by the following pushes, so save it now
16921692   int orig_fc = m68k->mmu_tmp_buserror_fc;
r15075r15076
17601760 * This is used by the 68040 for bus fault and mmu trap
17611761 * 30 words
17621762 */
1763void m68ki_stack_frame_0111(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu)
1763INLINE void m68ki_stack_frame_0111(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu)
17641764{
17651765   int orig_rw = m68k->mmu_tmp_buserror_rw;   // this gets splatted by the following pushes, so save it now
17661766   int orig_fc = m68k->mmu_tmp_buserror_fc;
r15075r15076
19551955
19561956
19571957/* Service an interrupt request and start exception processing */
1958void m68ki_exception_interrupt(m68ki_cpu_core *m68k, UINT32 int_level)
1958INLINE void m68ki_exception_interrupt(m68ki_cpu_core *m68k, UINT32 int_level)
19591959{
19601960   UINT32 vector;
19611961   UINT32 sr;
src/emu/cpu/i386/i386op16.c
r15075r15076
881881static void I386OP(jge_rel16)(i386_state *cpustate)         // Opcode 0x0f 8d
882882{
883883   INT16 disp = FETCH16(cpustate);
884   if( (cpustate->SF == cpustate->OF) ) {
884   if(cpustate->SF == cpustate->OF) {
885885      if (cpustate->sreg[CS].d)
886886      {
887887         cpustate->eip += disp;
src/emu/cpu/i386/i386ops.c
r15075r15076
449449static void I386OP(jge_rel8)(i386_state *cpustate)         // Opcode 0x7d
450450{
451451   INT8 disp = FETCH(cpustate);
452   if( (cpustate->SF == cpustate->OF) ) {
452   if(cpustate->SF == cpustate->OF) {
453453      NEAR_BRANCH(cpustate,disp);
454454      CYCLES(cpustate,CYCLES_JCC_DISP8);      /* TODO: Timing = 7 + m */
455455   } else {
r15075r15076
14111411{
14121412   UINT8 modrm = FETCH(cpustate);
14131413   UINT8 value = 0;
1414   if( (cpustate->SF == cpustate->OF) ) {
1414   if(cpustate->SF == cpustate->OF) {
14151415      value = 1;
14161416   }
14171417   if( modrm >= 0xc0 ) {
src/emu/cpu/i386/i386op32.c
r15075r15076
820820static void I386OP(jge_rel32)(i386_state *cpustate)         // Opcode 0x0f 8d
821821{
822822   INT32 disp = FETCH32(cpustate);
823   if( (cpustate->SF == cpustate->OF) ) {
823   if(cpustate->SF == cpustate->OF) {
824824      cpustate->eip += disp;
825825      CHANGE_PC(cpustate,cpustate->eip);
826826      CYCLES(cpustate,CYCLES_JCC_FULL_DISP);      /* TODO: Timing = 7 + m */
src/emu/sound/pokey.c
r15075r15076
274274   /* is this a filtering channel (3/4) and is the filter active? */   \
275275   if( chip->AUDCTL & ((CH1_FILTER|CH2_FILTER) & (0x10 >> ch)) )      \
276276    {                                                                   \
277      if( chip->output[ch-2] )                              \
277      if( ch >= 2 && chip->output[ch-2] )                        \
278278        {                                                               \
279279         chip->output[ch-2] = 0;                              \
280280         if( chip->audible[ch] )                              \
r15075r15076
318318   /* is this a filtering channel (3/4) and is the filter active? */   \
319319   if( chip->AUDCTL & ((CH1_FILTER|CH2_FILTER) & (0x10 >> ch)) )      \
320320    {                                                                   \
321      if( chip->output[ch-2] )                              \
321      if( ch >= 2 && chip->output[ch-2] )                        \
322322        {                                                               \
323323         chip->output[ch-2] = 0;                              \
324324         sum -= chip->volume[ch-2];                           \
src/emu/sound/tms5220.c
r15075r15076
988988#endif
989989
990990         /* if TS is now 0, ramp the energy down to 0. Is this really correct to hardware? */
991         if ( (tms->talk_status == 0))
991         if (tms->talk_status == 0)
992992         {
993993#ifdef DEBUG_GENERATION
994994            fprintf(stderr,"Talk status is 0, forcing target energy to 0\n");
src/emu/machine/eeprom.c
r15075r15076
240240
241241   /* handle hard-coded data from the driver */
242242   if (m_default_data.u8 != NULL)
243      for (offs_t offs = 0; offs < m_default_data_size; offs++)
243      for (offs_t offs = 0; offs < m_default_data_size; offs++) {
244244         if (m_data_bits == 8)
245245            m_addrspace[0]->write_byte(offs, m_default_data.u8[offs]);
246246         else
247247            m_addrspace[0]->write_word(offs * 2, m_default_data.u16[offs]);
248      }
248249
249250   /* populate from a memory region if present */
250251   if (m_region != NULL)
src/lib/lib7z/LzmaEnc.c
r15075r15076
20872087  CLzmaEnc *p = (CLzmaEnc *)pp;
20882088  if (p->mtMode)
20892089    MatchFinderMt_ReleaseStream(&p->matchFinderMt);
2090  #else
2091  pp = pp;
20922090  #endif
20932091}
20942092 
src/lib/formats/ioprocs.c
r15075r15076
106106   size_t bytes_to_write;
107107   UINT64 size;
108108
109   if (offset > 0x29c50)
110   {
111      offset = offset;
112   }
113
114109   size = io_generic_size(generic);
115110
116111   if (size < offset)
src/lib/formats/coco_dsk.c
r15075r15076
914914         else
915915         {
916916            /* check IDAM integrity and check for matching sector */
917            if ((sector == dmk_idam_sector(&track_data[idam_offset]))
917            if (sector == dmk_idam_sector(&track_data[idam_offset])
918918/*                  && (track == dmk_idam_track(&track_data[idam_offset]))  */
919919/*                  && (head == dmk_idam_side(&track_data[idam_offset]))    */
920920               )
src/lib/formats/apridisk.c
r15075r15076
125125   floppy_image_read(floppy, &header, 0, sizeof(header));
126126
127127   /* look for the magic string */
128   if (memcmp(header, apr_magic, sizeof(apr_magic)) == 0)
128   if (memcmp(header, apr_magic, sizeof(*apr_magic)) == 0)
129129      *vote = 100;
130130   else
131131      *vote = 0;
src/lib/libflac/libflac/md5.c
r15075r15076
263263
264264   byteSwap(ctx->buf, 4);
265265   memcpy(digest, ctx->buf, 16);
266   memset(ctx, 0, sizeof(ctx));   /* In case it's sensitive */
266   memset(ctx, 0, sizeof(*ctx));   /* In case it's sensitive */
267267   if(0 != ctx->internal_buf) {
268268      free(ctx->internal_buf);
269269      ctx->internal_buf = 0;
src/lib/util/un7z.c
r15075r15076
5252 
5353void *SZipAlloc(void *p, size_t size)
5454{
55   p = p;
5655   if (size == 0)
5756      return 0;
5857 
r15075r15076
6160 
6261void SZipFree(void *p, void *address)
6362{
64   p = p;
6563   free(address);
6664}
6765 

Previous 15994 Revisions Next


© 1998-2018 The MESS Team