buzzmachines icon indicating copy to clipboard operation
buzzmachines copied to clipboard

error: unknown type name 'u_long'; did you mean 'u_llong'?

Open trusktr opened this issue 11 years ago • 10 comments

I'm getting these errors while now that the fpu_control situation is handled:

Making install in SurfsDSPLib
  CXX      libdsplib_la-SRF_DSP.lo
In file included from SRF_DSP.cpp:1:
In file included from ./SRF_DSP.h:6:
./SRF_Resampler.h:7:31: error: unknown type name 'u_long'; did you mean 'u_llong'?
typedef void (*DoneCallback)( u_long );
                              ^~~~~~
                              u_llong
./SRF_Types.h:17:29: note: 'u_llong' declared here
typedef unsigned long long      u_llong;
                                ^
In file included from SRF_DSP.cpp:1:
In file included from ./SRF_DSP.h:6:
./SRF_Resampler.h:58:2: error: unknown type name 'u_long'; did you mean 'u_llong'?
        u_long                          m_iCBData;
        ^~~~~~
        u_llong
./SRF_Types.h:17:29: note: 'u_llong' declared here
typedef unsigned long long      u_llong;
                                ^
2 errors generated.

There's also these couple of warnings:

Making all in BuzzMachines
  CXX      libGeonik_s_Omega1_la-Omega1.lo
In file included from Omega1.cpp:29:
./../DspClasses/Volume.h:7:9: warning: 'inc_dspcvolume' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]
#ifndef inc_dspcvolume
        ^~~~~~~~~~~~~~
./../DspClasses/Volume.h:8:9: note: 'inc_dspcVolume' is defined here; did you mean 'inc_dspcvolume'?
#define inc_dspcVolume
        ^~~~~~~~~~~~~~
        inc_dspcvolume
1 warning generated.
Making all in M4
  CXX      libMakk_M4_la-M4.lo
M4.cpp:1474:33: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                        return "<B1>0 halfnotes";
                                ^~~~
M4.cpp:1483:33: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                        return "<B1>0 cents";
                                ^~~~
M4.cpp:1547:42: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
                        sprintf( txt, "%i<B0>", value*360/128);
                                         ^~~~
3 warnings generated.

trusktr avatar Nov 20 '14 06:11 trusktr

I replaced u_long and u_char with unsigned long and unsigned char, and got past these errors. Not sure if there's any negative implication of this though.

trusktr avatar Nov 26 '14 07:11 trusktr

I think this is the right fix. If you are unsure push to a branch, but I am fine if you'd like to push this fix to the master (remember to include 'Fixes #2' in the commit message though).

ensonic avatar Nov 26 '14 19:11 ensonic

@ensonic Would removing u_long, u_char, etc, introduce any portability problems on different architectures? Or is it just for shorthand?

trusktr avatar Nov 27 '14 00:11 trusktr

@trusktr those are just shorthands. Things like uint8 need more care.

ensonic avatar Nov 27 '14 19:11 ensonic

We actually need to fix ./Matilde/Tracker/SurfsDSPLib/SRF_Types.h to define them for MacOS too. According to http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system we can probably add APPLE like change #ifdef WIN32 to #if defined(WIN32) && defined(APPLE) Can you try it?

ensonic avatar Nov 29 '14 15:11 ensonic

@ensonic I'm now getting

  CXX      libElak_Dist2_la-dist2.lo
dist2.cpp:290:17: warning: use of unary operator that may be intended as compound assignment (-=)
                                                *psamples =- *psamples  ;
                                                          ^~
dist2.cpp:294:17: warning: use of unary operator that may be intended as compound assignment (+=)
                                                *psamples =+ *psamples ;

Are those supposed to be -= and +=? Or are they positive and negative?

trusktr avatar Dec 07 '14 23:12 trusktr

I think they ought to be -= and +=, please go ahead and make the change. That's why it is good to have all these sources in this repo.

ensonic avatar Dec 08 '14 11:12 ensonic

Are we sure the creator of Elak didn't mean something like

*psamples = (- *psamples);
// and 
*psamples = (+ *psamples);

?

trusktr avatar Dec 14 '14 05:12 trusktr

As we also have double const s = *psamples; in https://github.com/Buzztrax/buzzmachines/blob/master/Elak/Dist2/dist2.cpp#L282

we can rewrite https://github.com/Buzztrax/buzzmachines/blob/master/Elak/Dist2/dist2.cpp#L288-295 to if (s >= 0) { *psamples = -s ; } else { *psamples = +s ;
} but the 2nd part is kind of silly as it doesn't do anything. I looked a bit up in the code and it is quite buggy :/ I'll do a light cleanup.

ensonic avatar Dec 29 '14 15:12 ensonic

Pushed 5f06bd6a6fee52fd545214962b9b28828f9b5fb8, does that fix the build at least?

ensonic avatar Dec 29 '14 16:12 ensonic