vgmrips / vgmtools

A collection of tools for the VGM file format
GNU General Public License v2.0
123 stars 18 forks source link

Add CMake build script + few fixes of incorrect printf() usage in two files #8

Closed Wohlstand closed 5 years ago

Wohlstand commented 5 years ago

I have added CMake script as an alternative way to compile the project: CMake can be easily used to generate builds for a wide set of toolchains include various versions of MSVC, Xcode, Code::Blocks. CodeLite, Ninja, NMake, GNU/BSD Make, etc. Original makefile and other builds were kept.

The way to build by CMake is:

mkdir build
cd build
cmake ..
make -j 4
ValleyBell commented 5 years ago

Nice, thanks!

A small request though: Do you think you could fix the printf() commit to not add 500 whitespace-only changes? That would be really nice, because then I could actually see the important changes.

Wohlstand commented 5 years ago

A small request though: Do you think you could fix the printf() commit to not add 500 whitespace-only changes? That would be really nice, because then I could actually see the important changes.

Ok, gonna revert that to show the actual fix of printf() usage, anyway, I highly recommending to clean-up line-ending spaces as they are usually garbage, giving any pros and just increasing the size of file...

(If you want, I can make a separated PR to clean-up all line-ending spaces on the entire project, otherwise, your choice)

Wohlstand commented 5 years ago

Made just now! Commits are clear now!

Wohlstand commented 5 years ago

Anyway, there are next warnings I got originally:

$ ninja
[19/57] Building C object CMakeFiles/opl_23.dir/opl_23.c.o
../opl_23.c: In function ‘CompressVGMData’:
../opl_23.c:443:49: warning: unknown conversion type character ‘!’ in format [-Wformat=]
        printf("Warning! Stereo mismatch at 0x%06!\n", VGMPos);
                                                 ^
../opl_23.c:443:15: warning: too many arguments for format [-Wformat-extra-args]
        printf("Warning! Stereo mismatch at 0x%06!\n", VGMPos);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../opl_23.c:445:49: warning: unknown conversion type character ‘!’ in format [-Wformat=]
        printf("Warning! Stereo mismatch at 0x%06!\n", VGMPos);
                                                 ^
../opl_23.c:445:15: warning: too many arguments for format [-Wformat-extra-args]
        printf("Warning! Stereo mismatch at 0x%06!\n", VGMPos);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../opl_23.c:450:37: warning: unknown conversion type character ‘ ’ in format [-Wformat=]
        printf("Warning! Waveform %02 used at 0x%06!\n", VGMPnt[0x02], VGMPos);
                                     ^
../opl_23.c:450:51: warning: unknown conversion type character ‘!’ in format [-Wformat=]
        printf("Warning! Waveform %02 used at 0x%06!\n", VGMPnt[0x02], VGMPos);
                                                   ^
../opl_23.c:450:15: warning: too many arguments for format [-Wformat-extra-args]
        printf("Warning! Waveform %02 used at 0x%06!\n", VGMPnt[0x02], VGMPos);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[22/57] Building C object CMakeFiles/vgm2txt.dir/chiptext.c.o
../chiptext.c: In function ‘ymf278b_write’:
../chiptext.c:1860:25: warning: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 3 has type ‘char *’ [-Wformat=]
     sprintf(WriteStr, "%S Mix L: 0x%01X = %u%%, 0x%01X = %u%%",
                        ~^
                        %s
       (Register == 0xF9) ? "PCM" : "FM",
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[57/57] Linking C executable vgm_sptd
ValleyBell commented 5 years ago

Thanks a lot!