Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
trusktr opened this issue Nov 20, 2014 · 10 comments
Open

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

trusktr opened this issue Nov 20, 2014 · 10 comments

Comments

@trusktr
Copy link
Member

trusktr commented Nov 20, 2014

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
Copy link
Member Author

trusktr commented Nov 26, 2014

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.

@ensonic
Copy link
Member

ensonic commented Nov 26, 2014

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).

@trusktr
Copy link
Member Author

trusktr commented Nov 27, 2014

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

@ensonic
Copy link
Member

ensonic commented Nov 27, 2014

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

@ensonic
Copy link
Member

ensonic commented Nov 29, 2014

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?

@trusktr
Copy link
Member Author

trusktr commented Dec 7, 2014

@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?

@ensonic
Copy link
Member

ensonic commented Dec 8, 2014

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.

@trusktr
Copy link
Member Author

trusktr commented Dec 14, 2014

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

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

?

@ensonic
Copy link
Member

ensonic commented Dec 29, 2014

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
Copy link
Member

ensonic commented Dec 29, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants