zamaudio / ptformat

Free software file format parser for Avid ProTools sessions
GNU Lesser General Public License v2.1
71 stars 18 forks source link

Compilation fails on OS X #8

Closed mauritslamers closed 5 years ago

mauritslamers commented 5 years ago

Under OSX El Capitan, compilation fails with all options:

I only include make clangall, as c++ is an alias for clang++, which makes the other options fail because of incorrect command line parameters.

make clangall

clang++ -o ptftool -g -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I. -Woverloaded-virtual -Wno-mismatched-tags -ansi -Wnon-virtual-dtor -Woverloaded-virtual -fstrict-overflow -Wall -Wcast-align -Wextra -Wwrite-strings -Wno-unused-function -std=c++98 ptftool.cc ptfformat.cc
ptftool.cc:35:3: error: use of undeclared identifier 'exit'
                exit(0);
                ^
ptftool.cc:44:3: error: use of undeclared identifier 'exit'
                exit(-1);
                ^
ptftool.cc:131:2: error: use of undeclared identifier 'exit'
        exit(0);
        ^
3 errors generated.
ptfformat.cc:686:4: warning: variable 'rindex' is uninitialized when used here [-Wuninitialized]
                        rindex,
                        ^~~~~~
ptfformat.cc:551:17: note: initialize the variable 'rindex' to silence this warning
        uint16_t rindex;
                       ^
                        = 0
ptfformat.cc:1170:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1170:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
ptfformat.cc:1349:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1349:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
3 warnings generated.
make: *** [clangall] Error 1
zamaudio commented 5 years ago

Probably missing a std library header? Can you fix it?

mauritslamers commented 5 years ago

See PR #9

Compilation succeeds now, with the following log:

clang++ -o ptftool -g -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I. -Woverloaded-virtual -Wno-mismatched-tags -ansi -Wnon-virtual-dtor -Woverloaded-virtual -fstrict-overflow -Wall -Wcast-align -Wextra -Wwrite-strings -Wno-unused-function -std=c++98 ptftool.cc ptfformat.cc
ptfformat.cc:686:4: warning: variable 'rindex' is uninitialized when used here [-Wuninitialized]
                        rindex,
                        ^~~~~~
ptfformat.cc:551:17: note: initialize the variable 'rindex' to silence this warning
        uint16_t rindex;
                       ^
                        = 0
ptfformat.cc:1170:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1170:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
ptfformat.cc:1349:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1349:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
3 warnings generated.
clang++ -o ptunxor -g -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I. -Woverloaded-virtual -Wno-mismatched-tags -ansi -Wnon-virtual-dtor -Woverloaded-virtual -fstrict-overflow -Wall -Wcast-align -Wextra -Wwrite-strings -Wno-unused-function -std=c++98 ptunxor.cc ptfformat.cc
ptfformat.cc:686:4: warning: variable 'rindex' is uninitialized when used here [-Wuninitialized]
                        rindex,
                        ^~~~~~
ptfformat.cc:551:17: note: initialize the variable 'rindex' to silence this warning
        uint16_t rindex;
                       ^
                        = 0
ptfformat.cc:1170:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1170:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
ptfformat.cc:1349:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1349:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
3 warnings generated.
clang++ -o ptgenmissing -g -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I. -Woverloaded-virtual -Wno-mismatched-tags -ansi -Wnon-virtual-dtor -Woverloaded-virtual -fstrict-overflow -Wall -Wcast-align -Wextra -Wwrite-strings -Wno-unused-function -std=c++98 ptgenmissing.cc ptfformat.cc
ptfformat.cc:686:4: warning: variable 'rindex' is uninitialized when used here [-Wuninitialized]
                        rindex,
                        ^~~~~~
ptfformat.cc:551:17: note: initialize the variable 'rindex' to silence this warning
        uint16_t rindex;
                       ^
                        = 0
ptfformat.cc:1170:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1170:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^~~~
ptfformat.cc:1349:24: warning: taking the absolute value of unsigned type 'unsigned long long' has no effect [-Wabsolute-value]
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
                                                   ^
ptfformat.cc:1349:24: note: remove the call to 'labs' since unsigned values cannot be negative
                                mtr.reg.startpos = labs(region_pos - mtr.reg.startpos);
mauritslamers commented 5 years ago

Additionally, while running ptreg to verify everything is correct, the following report is generated:

PT12 with midi
[ OK ]

PT5 1
@@ -17,8 +17,8 @@
-`Bass_L_01` r(0) w(6) @ 0, 1377004
-`Bass_R_01` r(1) w(7) @ 0, 1377004
-`cymb_L_01` r(2) w(5) @ 0, 1355463
-`cymb_R_01` r(3) w(0) @ 0, 1355463
-`DR_L` r(4) w(4) @ 0, 1377004
-`DR_R` r(5) w(3) @ 0, 1377004
-`Rhodes_L_01` r(6) w(2) @ 0, 1377004
-`Rhodes_R_01` r(7) w(1) @ 0, 1377004
+`Bass_L_01` r(26977) w(6) @ 0, 1377004
+`Bass_R_01` r(26978) w(7) @ 0, 1377004
+`cymb_L_01` r(26979) w(5) @ 0, 1355463
+`cymb_R_01` r(26980) w(0) @ 0, 1355463
+`DR_L` r(26981) w(4) @ 0, 1377004
+`DR_R` r(26982) w(3) @ 0, 1377004
+`Rhodes_L_01` r(26983) w(2) @ 0, 1377004
+`Rhodes_R_01` r(26984) w(1) @ 0, 1377004
@@ -29,4 +29,4 @@
-`DR_L` t(1) r(4) @ 0
-`DR_R` t(2) r(5) @ 0
-`Rhodes_L` t(3) r(6) @ 0
-`Rhodes_R` t(4) r(7) @ 0
+`DR_L` t(1) r(0) @ 0
+`DR_R` t(2) r(0) @ 0
+`Rhodes_L` t(3) r(0) @ 0
+`Rhodes_R` t(4) r(0) @ 0
@@ -34,3 +34,3 @@
-`Bass_R` t(6) r(1) @ 0
-`cymb_L` t(7) r(2) @ 0
-`cymb_R` t(8) r(3) @ 0
+`Bass_R` t(6) r(0) @ 0
+`cymb_L` t(7) r(0) @ 0
+`cymb_R` t(8) r(0) @ 0
@@ -41,8 +41,8 @@
-`DR_L` t(1) (DR_L.aif) @ 0 + 0, 1377004
-`DR_R` t(2) (DR_R.aif) @ 0 + 0, 1377004
-`Rhodes_L` t(3) (Rhodes_L_01.aif) @ 0 + 0, 1377004
-`Rhodes_R` t(4) (Rhodes_R_01.aif) @ 0 + 0, 1377004
-`Bass_L` t(5) (Bass_L_01.aif) @ 0 + 0, 1377004
-`Bass_R` t(6) (Bass_R_01.aif) @ 0 + 0, 1377004
-`cymb_L` t(7) (cymb_L_01.aif) @ 0 + 0, 1355463
-`cymb_R` t(8) (cymb_R_01.aif) @ 0 + 0, 1355463
+`DR_L` t(1) () @ 0 + 0, 1377004
+`DR_R` t(2) () @ 0 + 0, 1377004
+`Rhodes_L` t(3) () @ 0 + 0, 1377004
+`Rhodes_R` t(4) () @ 0 + 0, 1377004
+`Bass_L` t(5) () @ 0 + 0, 1377004
+`Bass_R` t(6) () @ 0 + 0, 1377004
+`cymb_L` t(7) () @ 0 + 0, 1355463
+`cymb_R` t(8) () @ 0 + 0, 1355463
[FAIL]

PT5 2
@@ -10 +10 @@
-`24000` r(0) w(0) @ 0, 24000
+`24000` r(26977) w(0) @ 0, 24000
@@ -33,14 +33,14 @@
-`24000` t(1) (24000.aif) @ 0 + 0, 24000
-`24000` t(1) (24000.aif) @ 24000 + 0, 24000
-`24000` t(1) (24000.aif) @ 48000 + 0, 24000
-`24000` t(1) (24000.aif) @ 72000 + 0, 24000
-`24000` t(1) (24000.aif) @ 96000 + 0, 24000
-`24000` t(1) (24000.aif) @ 120000 + 0, 24000
-`24000` t(1) (24000.aif) @ 144000 + 0, 24000
-`24000` t(1) (24000.aif) @ 168000 + 0, 24000
-`Audio 1` t(2) (24000.aif) @ 16384 + 0, 24000
-`Audio 1` t(2) (24000.aif) @ 80832 + 0, 24000
-`Audio 1` t(2) (24000.aif) @ 153024 + 0, 24000
-`Audio 2` t(3) (24000.aif) @ 45440 + 0, 24000
-`Audio 2` t(3) (24000.aif) @ 136448 + 0, 24000
-`Audio 3` t(4) (24000.aif) @ 94528 + 0, 24000
+`24000` t(1) () @ 0 + 0, 24000
+`24000` t(1) () @ 24000 + 0, 24000
+`24000` t(1) () @ 48000 + 0, 24000
+`24000` t(1) () @ 72000 + 0, 24000
+`24000` t(1) () @ 96000 + 0, 24000
+`24000` t(1) () @ 120000 + 0, 24000
+`24000` t(1) () @ 144000 + 0, 24000
+`24000` t(1) () @ 168000 + 0, 24000
+`Audio 1` t(2) () @ 16384 + 0, 24000
+`Audio 1` t(2) () @ 80832 + 0, 24000
+`Audio 1` t(2) () @ 153024 + 0, 24000
+`Audio 2` t(3) () @ 45440 + 0, 24000
+`Audio 2` t(3) () @ 136448 + 0, 24000
+`Audio 3` t(4) () @ 94528 + 0, 24000
[FAIL]

PT5 3
@@ -15,6 +15,6 @@
-`bass_01.L` r(0) w(0) @ 0, 1758775
-`bass_01.R` r(1) w(1) @ 0, 1758775
-`oerc_01.L` r(2) w(5) @ 0, 1643572
-`oerc_01.R` r(3) w(4) @ 0, 1643572
-`rhodes_01.L` r(4) w(3) @ 0, 1528453
-`rhodes_01.R` r(5) w(2) @ 0, 1528453
+`bass_01.L` r(25704) w(0) @ 0, 1758775
+`bass_01.R` r(25705) w(1) @ 0, 1758775
+`oerc_01.L` r(25706) w(5) @ 0, 1643572
+`oerc_01.R` r(25707) w(4) @ 0, 1643572
+`rhodes_01.L` r(25708) w(3) @ 0, 1528453
+`rhodes_01.R` r(25709) w(2) @ 0, 1528453
@@ -25,6 +25,6 @@
-`rhodes` t(1) r(4) @ 0
-`rhodes` t(1) r(5) @ 0
-`bass` t(2) r(0) @ 0
-`bass` t(2) r(1) @ 0
-`oerc` t(3) r(2) @ 0
-`oerc` t(3) r(3) @ 0
+`rhodes` t(1) r(48448) @ 0
+`rhodes` t(1) r(48448) @ 0
+`bass` t(2) r(48448) @ 0
+`bass` t(2) r(48448) @ 0
+`oerc` t(3) r(48448) @ 0
+`oerc` t(3) r(48448) @ 0
@@ -35,6 +35,6 @@
-`rhodes` t(1) (rhodes_01.L) @ 0 + 0, 1528453
-`rhodes` t(1) (rhodes_01.R) @ 0 + 0, 1528453
-`bass` t(2) (bass_01.L) @ 0 + 0, 1758775
-`bass` t(2) (bass_01.R) @ 0 + 0, 1758775
-`oerc` t(3) (oerc_01.L) @ 0 + 0, 1643572
-`oerc` t(3) (oerc_01.R) @ 0 + 0, 1643572
+`rhodes` t(1) () @ 0 + 0, 1528453
+`rhodes` t(1) () @ 0 + 0, 1528453
+`bass` t(2) () @ 0 + 0, 1758775
+`bass` t(2) () @ 0 + 0, 1758775
+`oerc` t(3) () @ 0 + 0, 1643572
+`oerc` t(3) () @ 0 + 0, 1643572
[FAIL]

PT8 testing 3 point audio rearrangements
[ OK ]

PT8 with midi
[ OK ]
zamaudio commented 5 years ago

Interesting, is that an old powerpc mac you're using?

zamaudio commented 5 years ago

Also, I assume you are testing on commit 877fa28 ?

zamaudio commented 5 years ago

Thanks, merged and I fixed this bug, can you retest the regression tests please on latest master. Thanks

mauritslamers commented 5 years ago

I am not using an old PPC mac, just a 2012 macbook pro running El Capitan. All compilation errors are gone and the ptreg tool doesn't report problems. I was indeed on commit 877fa28.

zamaudio commented 5 years ago

Great! Thanks and enjoy the tool!