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

Fix undefined behaviour. #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/calamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace std;
// =======================================================================
// Start of program
// =======================================================================
int cshortswap( complex<short>* f )
void cshortswap( complex<short>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<short> f2;
Expand All @@ -49,7 +49,7 @@ int cshortswap( complex<short>* f )
f[0]=f2;
}

int cfloatswap( complex<float>* f )
void cfloatswap( complex<float>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<float> f2;
Expand Down
10 changes: 5 additions & 5 deletions src/selpsc_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using namespace std;
// =======================================================================
// Start of program
// =======================================================================
int cshortswap( complex<short>* f )
void cshortswap( complex<short>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<short> f2;
Expand All @@ -59,7 +59,7 @@ int cshortswap( complex<short>* f )
f[0]=f2;
}

int shortswap( short* f )
void shortswap( short* f )
{
char* b = reinterpret_cast<char*>(f);
short f2;
Expand All @@ -69,7 +69,7 @@ int shortswap( short* f )
f[0]=f2;
}

int cfloatswap( complex<float>* f )
void cfloatswap( complex<float>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<float> f2;
Expand All @@ -85,7 +85,7 @@ int cfloatswap( complex<float>* f )
f[0]=f2;
}

int floatswap( float* f )
void floatswap( float* f )
{
char* b = reinterpret_cast<char*>(f);
float f2;
Expand All @@ -97,7 +97,7 @@ int floatswap( float* f )
f[0]=f2;
}

int longswap( int32_t* f )
void longswap( int32_t* f )
{
char* b = reinterpret_cast<char*>(f);
int32_t f2;
Expand Down
6 changes: 3 additions & 3 deletions src/selsbc_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using namespace std;
// =======================================================================
// Start of program
// =======================================================================
int cshortswap( complex<short>* f )
void cshortswap( complex<short>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<short> f2;
Expand All @@ -60,7 +60,7 @@ int cshortswap( complex<short>* f )
f[0]=f2;
}

int cfloatswap( complex<float>* f )
void cfloatswap( complex<float>* f )
{
char* b = reinterpret_cast<char*>(f);
complex<float> f2;
Expand All @@ -75,7 +75,7 @@ int cfloatswap( complex<float>* f )
b2[7] = b[4];
f[0]=f2;
}
int longswap( int32_t* f )
void longswap( int32_t* f )
{
char* b = reinterpret_cast<char*>(f);
int32_t f2;
Expand Down