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

Clang error cleanup #32

Open
wants to merge 2 commits 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
2 changes: 1 addition & 1 deletion r2fft_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "fft.h"

#define Float double
#define FFTsize 1024

template <class Type>
double Power(std::complex<Type> X)
Expand All @@ -15,7 +16,6 @@ int main(int argc, char *argv[])
r2FFT<Float> FFT;
DFT1d<Float> RefFFT;

int FFTsize = 1024;
std::complex<Float> Buffer[FFTsize];

FFT.Preset(FFTsize);
Expand Down
4 changes: 2 additions & 2 deletions socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class SocketBuffer // data buffer for IP sockets
{ if(Data) { free(Data); Data=0; }
Allocated=0; Len=0; Done=0; }

size_t Relocate(size_t Size)
size_t Relocate(size_t Size) // Returns 0 on failure
{ if(Size<=Allocated) return Allocated;
// printf("Relocate(%d)",Size);
size_t Units=(Size+AllocUnit-1)/AllocUnit; Size=Units*AllocUnit;
Expand Down Expand Up @@ -199,7 +199,7 @@ class SocketBuffer // data buffer for IP sockets
{ FILE *File = fopen(FileName,"r"); if(File==0) return -1;
int Total=0;
for( ; ; )
{ if(Relocate(Len+AllocUnit)<0) { fclose(File); return -1; }
{ if(Relocate(Len+AllocUnit)==0) { fclose(File); return -1; }
int ToRead = Allocated-Len;
int Read = fread(Data+Len, 1, ToRead, File);
if(Read<0) { fclose(File); return -1; }
Expand Down