changeset 2282:6c3c3355007d

Fix conversion of unoptimized modules in xm2jss.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Jun 2019 12:31:29 +0300
parents 167ec99e57a5
children 2c90e455f006
files tools/xm2jss.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tools/xm2jss.c	Tue Jun 18 12:31:17 2019 +0300
+++ b/tools/xm2jss.c	Tue Jun 18 12:31:29 2019 +0300
@@ -577,12 +577,18 @@
 
     // Convert and write patterns
     for (totalSize = index = 0; index < module->npatterns; index++)
-    if (module->patterns[index] != NULL)
     {
         JSSPattern *pattern = module->patterns[index];
         size_t dataSize = 0;
         int ret;
 
+        if (pattern == NULL)
+        {
+            dmMsg(1,
+            "Pattern #%d is NULL.\n", index);
+            pattern = module->patterns[module->npatterns];
+        }
+
         if (pattern->nrows > jsetMaxRows)
         {
             JSSERROR(DMERR_INVALID_DATA, DMERR_INVALID_DATA,
@@ -649,11 +655,6 @@
             index);
         }
     }
-    else
-    {
-        JSSERROR(DMERR_NULLPTR, DMERR_NULLPTR,
-        "Pattern #%d was NULL.\n", index);
-    }
 
     dmFree(patBuf);
     dmMsg(1," * %d patterns, %d bytes.\n",
@@ -669,8 +670,8 @@
         {
             einst = &tmpEInst;
             memset(&tmpEInst, 0, sizeof(tmpEInst));
-            JSSWARNING(DMERR_NULLPTR, DMERR_NULLPTR,
-            "Extended instrument #%d NULL!\n",
+            dmMsg(1,
+            "Extended instrument #%d is NULL!\n",
             index);
         }