]> Git Repo - qemu.git/blobdiff - hw/fmopl.c
rtl8139: add format attribute to DPRINTF
[qemu.git] / hw / fmopl.c
index 52cf35e3f9425fd7b0fdc5b89bb0885898449474..d8a0f36b357a130ed22fd66f34f0cf9b58d234cd 100644 (file)
@@ -27,8 +27,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #define INLINE         static inline
 #define PI 3.14159265358979323846
 #endif
 
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
 /* -------------------- for debug --------------------- */
 /* #define OPL_OUTPUT_LOG */
 #ifdef OPL_OUTPUT_LOG
@@ -596,7 +599,7 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE )
                OPL->AR_TABLE[i] = rate / ARRATE;
                OPL->DR_TABLE[i] = rate / DRRATE;
        }
-       for (i = 60;i < 76;i++)
+       for (i = 60; i < ARRAY_SIZE(OPL->AR_TABLE); i++)
        {
                OPL->AR_TABLE[i] = EG_AED-1;
                OPL->DR_TABLE[i] = OPL->DR_TABLE[60];
@@ -1343,8 +1346,9 @@ unsigned char OPLRead(FM_OPL *OPL,int a)
                {
                        if(OPL->keyboardhandler_r)
                                return OPL->keyboardhandler_r(OPL->keyboard_param);
-                       else
+                       else {
                                LOG(LOG_WAR,("OPL:read unmapped KEYBOARD port\n"));
+                       }
                }
                return 0;
 #if 0
@@ -1356,8 +1360,9 @@ unsigned char OPLRead(FM_OPL *OPL,int a)
                {
                        if(OPL->porthandler_r)
                                return OPL->porthandler_r(OPL->port_param);
-                       else
+                       else {
                                LOG(LOG_WAR,("OPL:read unmapped I/O port\n"));
+                       }
                }
                return 0;
        case 0x1a: /* PCM-DATA    */
This page took 0.026536 seconds and 4 git commands to generate.