Mercurial > hg > dmlib
changeset 796:97ecc0a9c21f
Silence some "probing".
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 18 Oct 2013 19:47:30 +0300 |
parents | 926e3900119c |
children | f066e9dccf29 |
files | dmengine.c minijss/jloadjss.c minijss/jloadxm.c minijss/jssmod.h tests/plrtest.c tools/mod2wav.c tools/ppl.c tools/viewmod.c tools/xm2jss.c |
diffstat | 9 files changed, 26 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/dmengine.c Fri Oct 18 19:40:44 2013 +0300 +++ b/dmengine.c Fri Oct 18 19:47:30 2013 +0300 @@ -136,7 +136,7 @@ #ifdef JSS_SUP_XM static int engineResXMModuleLoad(DMResource *res) { - return jssLoadXM(res, (JSSModule **) &(res->resData)); + return jssLoadXM(res, (JSSModule **) &(res->resData), FALSE); } static void engineResXMModuleFree(DMResource *res) @@ -155,7 +155,7 @@ #ifdef JSS_SUP_JSSMOD static int engineResJSSModuleLoad(DMResource *res) { - return jssLoadJSSMOD(res, (JSSModule **) &(res->resData)); + return jssLoadJSSMOD(res, (JSSModule **) &(res->resData), FALSE); } static void engineResJSSModuleFree(DMResource *res)
--- a/minijss/jloadjss.c Fri Oct 18 19:40:44 2013 +0300 +++ b/minijss/jloadjss.c Fri Oct 18 19:47:30 2013 +0300 @@ -295,7 +295,7 @@ #endif -int jssLoadJSSMOD(DMResource *inFile, JSSModule **ppModule) +int jssLoadJSSMOD(DMResource *inFile, JSSModule **ppModule, BOOL probe) { JSSModule *module; JSSMODHeader jssH; @@ -309,8 +309,11 @@ if (memcmp(jssH.idMagic, "JM", 2) != 0) { - JSSERROR(DMERR_INVALID_DATA, DMERR_INVALID_DATA, - "Not a valid JSSMOD file, header signature missing!\n"); + if (probe) + return DMERR_NOT_SUPPORTED; + else + JSSERROR(DMERR_NOT_SUPPORTED, DMERR_NOT_SUPPORTED, + "Not a JSSMOD file, header signature mismatch!\n"); } if (jssH.idVersion != JSSMOD_VERSION)
--- a/minijss/jloadxm.c Fri Oct 18 19:40:44 2013 +0300 +++ b/minijss/jloadxm.c Fri Oct 18 19:47:30 2013 +0300 @@ -603,7 +603,7 @@ /* Load XM-format module from given file-stream */ -int jssLoadXM(DMResource *inFile, JSSModule **ppModule) +int jssLoadXM(DMResource *inFile, JSSModule **ppModule, BOOL probe) { JSSModule *module; XMHeader xmH; @@ -634,8 +634,11 @@ // Check the fields, none of these are considered fatal if (strncmp(xmH.idMagic, "Extended Module: ", 17) != 0) { - JSSERROR(DMERR_NOT_SUPPORTED, DMERR_NOT_SUPPORTED, - "Not a FT2 Extended Module (XM), ident mismatch!\n"); + if (probe) + return DMERR_NOT_SUPPORTED; + else + JSSERROR(DMERR_NOT_SUPPORTED, DMERR_NOT_SUPPORTED, + "Not a FT2 Extended Module (XM), header signature mismatch!\n"); } if (xmH.version != 0x0104)
--- a/minijss/jssmod.h Fri Oct 18 19:40:44 2013 +0300 +++ b/minijss/jssmod.h Fri Oct 18 19:47:30 2013 +0300 @@ -301,11 +301,11 @@ JSSExtInstrument * jssAllocateExtInstrument(void); #ifdef JSS_SUP_XM -int jssLoadXM(DMResource *, JSSModule **); +int jssLoadXM(DMResource *, JSSModule **, BOOL); #endif #ifdef JSS_SUP_JSSMOD -int jssLoadJSSMOD(DMResource *, JSSModule **); +int jssLoadJSSMOD(DMResource *, JSSModule **, BOOL); #endif #ifdef __cplusplus
--- a/tests/plrtest.c Fri Oct 18 19:40:44 2013 +0300 +++ b/tests/plrtest.c Fri Oct 18 19:47:30 2013 +0300 @@ -141,19 +141,19 @@ fprintf(stderr, "Reading file: %s\n", inFilename); #ifdef JSS_SUP_XM fprintf(stderr, "* Trying XM...\n"); - result = jssLoadXM(file, &mod); + result = jssLoadXM(file, &mod, FALSE); #ifdef JSS_SUP_JSSMOD if (result != 0) { dmfseek(file, 0L, SEEK_SET); dmMsg(1, "* Trying JSSMOD ...\n"); - result = jssLoadJSSMOD(file, &mod); + result = jssLoadJSSMOD(file, &mod, FALSE); } #endif #else #ifdef JSS_SUP_JSSMOD dmMsg(1, "* Trying JSSMOD ...\n"); - result = jssLoadJSSMOD(file, &mod); + result = jssLoadJSSMOD(file, &mod, FALSE); #endif #endif dmf_close(file);
--- a/tools/mod2wav.c Fri Oct 18 19:40:44 2013 +0300 +++ b/tools/mod2wav.c Fri Oct 18 19:47:30 2013 +0300 @@ -164,14 +164,14 @@ fprintf(stderr, "Reading file: %s\n", optInFilename); #ifdef JSS_SUP_XM fprintf(stderr, "* Trying XM...\n"); - result = jssLoadXM(inFile, &mod); + result = jssLoadXM(inFile, &mod, FALSE); #endif #ifdef JSS_SUP_JSSMOD if (result != 0) { dmfseek(inFile, 0L, SEEK_SET); dmMsg(1, "* Trying JSSMOD ...\n"); - result = jssLoadJSSMOD(inFile, &mod); + result = jssLoadJSSMOD(inFile, &mod, FALSE); } #endif dmf_close(inFile);
--- a/tools/ppl.c Fri Oct 18 19:40:44 2013 +0300 +++ b/tools/ppl.c Fri Oct 18 19:47:30 2013 +0300 @@ -595,14 +595,14 @@ dmMsg(1, "Reading file: %s\n", optFilename); #ifdef JSS_SUP_XM dmMsg(2, "* Trying XM...\n"); - result = jssLoadXM(file, &engine.mod); + result = jssLoadXM(file, &engine.mod, FALSE); #endif #ifdef JSS_SUP_JSSMOD if (result != 0) { dmfseek(file, 0L, SEEK_SET); dmMsg(1, "* Trying JSSMOD ...\n"); - result = jssLoadJSSMOD(file, &engine.mod); + result = jssLoadJSSMOD(file, &engine.mod, FALSE); } #endif dmf_close(file);
--- a/tools/viewmod.c Fri Oct 18 19:40:44 2013 +0300 +++ b/tools/viewmod.c Fri Oct 18 19:47:30 2013 +0300 @@ -412,14 +412,14 @@ dmMsg(1, "Reading file: %s\n", optFilename); #ifdef JSS_SUP_XM dmMsg(1, "* Trying XM...\n"); - result = jssLoadXM(file, &mod); + result = jssLoadXM(file, &mod, FALSE); #endif #ifdef JSS_SUP_JSSMOD if (result != 0) { dmfseek(file, 0L, SEEK_SET); dmMsg(1, "* Trying JSSMOD ...\n"); - result = jssLoadJSSMOD(file, &mod); + result = jssLoadJSSMOD(file, &mod, TRUE); } #endif dmf_close(file);