Browse Source

Eliminate more warnings & fix one typo bug

LouYihua 6 years ago
parent
commit
651bf2a27b
4 changed files with 8 additions and 8 deletions
  1. 5 5
      adplug/rix.cpp
  2. 1 1
      android/app/src/main/cpp/native_midi.c
  3. 1 1
      libmad/frame.c
  4. 1 1
      uibattle.c

+ 5 - 5
adplug/rix.cpp

@@ -221,7 +221,7 @@ inline void CrixPlayer::set_new_int()
 /*----------------------------------------------------------*/
 inline void CrixPlayer::Pause()
 {
-  register uint16_t i;
+  uint16_t i;
   pause_flag = 1;
   for(i=0;i<11;i++)
     switch_ad_bd(i);
@@ -437,7 +437,7 @@ inline void CrixPlayer::ad_a0b0l_reg(uint16_t index,uint16_t p2,uint16_t p3)
 /*--------------------------------------------------------------*/
 inline void CrixPlayer::rix_B0_pro(uint16_t ctrl_l,uint16_t index)
 {
-  register int temp = 0;
+  int temp = 0;
   if(rhythm == 0 || ctrl_l < 6) temp = modify[ctrl_l*2+1];
   else
     {
@@ -450,7 +450,7 @@ inline void CrixPlayer::rix_B0_pro(uint16_t ctrl_l,uint16_t index)
 /*--------------------------------------------------------------*/
 inline void CrixPlayer::rix_C0_pro(uint16_t ctrl_l,uint16_t index)
 {
-  register uint16_t i = index>=12?index-12:0;
+  uint16_t i = index>=12?index-12:0;
   if(ctrl_l < 6 || rhythm == 0)
     {
       ad_a0b0l_reg(ctrl_l,i,1);
@@ -486,7 +486,7 @@ inline void CrixPlayer::switch_ad_bd(uint16_t index)
 /*--------------------------------------------------------------*/
 inline void CrixPlayer::ins_to_reg(uint16_t index,uint16_t* insb,uint16_t value)
 {
-  register uint16_t i;
+  uint16_t i;
   for(i=0;i<13;i++) reg_bufs[index].v[i] = insb[i];
   reg_bufs[index].v[13] = value&3;
   ad_bd_reg(),ad_08_reg(),
@@ -564,7 +564,7 @@ inline void CrixPlayer::ad_a0b0_reg(uint16_t index)
 /*--------------------------------------------------------------*/
 inline void CrixPlayer::music_ctrl()
 {
-  register int i;
+  int i;
   for(i=0;i<11;i++)
     switch_ad_bd(i);
 }

+ 1 - 1
android/app/src/main/cpp/native_midi.c

@@ -59,7 +59,7 @@ NativeMidiSong *native_midi_loadsong_RW(SDL_RWops *rw)
     {
         char buf[4096];
         size_t bytes;
-        while(bytes = SDL_RWread(rw, buf, sizeof(char), sizeof(buf)))
+        while((bytes = SDL_RWread(rw, buf, sizeof(char), sizeof(buf))) > 0)
             fwrite(buf, sizeof(char), bytes, fp);
         fclose(fp);
 

+ 1 - 1
libmad/frame.c

@@ -142,7 +142,7 @@ int decode_header(struct mad_header *header, struct mad_stream *stream)
   /* layer */
   header->layer = 4 - mad_bit_read(&stream->ptr, 2);
 
-  if (header->layer == 4) {
+  if ((int)header->layer == 4) {
     stream->error = MAD_ERROR_BADLAYER;
     return -1;
   }

+ 1 - 1
uibattle.c

@@ -1437,7 +1437,7 @@ PAL_BattleUIUpdate(
 
       if (g_Battle.UI.wActionType == kBattleActionCoopMagic)
       {
-         if (!PAL_BattleUIIsActionValid(kBattleActionCoopMagic))
+         if (!PAL_BattleUIIsActionValid(kBattleUIActionCoopMagic))
          {
             g_Battle.UI.state = kBattleUISelectMove;
             break;