mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-25 05:25:27 -04:00
IIR and FIR Kit: replaced NULL by 0
This commit is contained in:
parent
47f214fdf0
commit
0f821b0135
@ -63,8 +63,8 @@ void FFT(double *InputR, double *InputI, int N, TTransFormType Type) {
|
|||||||
TwiddleI = new double[N / 2];
|
TwiddleI = new double[N / 2];
|
||||||
RevBits = new int[N];
|
RevBits = new int[N];
|
||||||
|
|
||||||
if (BufferR == NULL || BufferI == NULL || TwiddleR == NULL
|
if (BufferR == 0 || BufferI == 0 || TwiddleR == 0
|
||||||
|| TwiddleI == NULL || RevBits == NULL) {
|
|| TwiddleI == 0 || RevBits == 0) {
|
||||||
// ShowMessage("FFT Memory Allocation Error");
|
// ShowMessage("FFT Memory Allocation Error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -339,8 +339,8 @@ void DFT(double *InputR, double *InputI, int N, int Type) {
|
|||||||
TwiddleReal = new double[N];
|
TwiddleReal = new double[N];
|
||||||
TwiddleImag = new double[N];
|
TwiddleImag = new double[N];
|
||||||
|
|
||||||
if (SumR == NULL || SumI == NULL || TwiddleReal == NULL
|
if (SumR == 0 || SumI == 0 || TwiddleReal == 0
|
||||||
|| TwiddleImag == NULL || (Type != FORWARD && Type != INVERSE)) {
|
|| TwiddleImag == 0 || (Type != FORWARD && Type != INVERSE)) {
|
||||||
// ShowMessage("Incorrect DFT Type or unable to allocate memory");
|
// ShowMessage("Incorrect DFT Type or unable to allocate memory");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -398,7 +398,7 @@ void RealSigDFT(double *Samples, double *OutputR, double *OutputI, int N) {
|
|||||||
|
|
||||||
TwiddleReal = new double[N];
|
TwiddleReal = new double[N];
|
||||||
TwiddleImag = new double[N];
|
TwiddleImag = new double[N];
|
||||||
if (TwiddleReal == NULL || TwiddleImag == NULL) {
|
if (TwiddleReal == 0 || TwiddleImag == 0) {
|
||||||
// ShowMessage("Failed to allocate memory in RealSigDFT");
|
// ShowMessage("Failed to allocate memory in RealSigDFT");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -579,7 +579,7 @@ void WindowData(double *Data, int N, TWindowType WindowType, double Alpha,
|
|||||||
Beta = 10.0;
|
Beta = 10.0;
|
||||||
|
|
||||||
WinCoeff = new double[N + 2];
|
WinCoeff = new double[N + 2];
|
||||||
if (WinCoeff == NULL) {
|
if (WinCoeff == 0) {
|
||||||
// ShowMessage("Failed to allocate memory in WindowData() ");
|
// ShowMessage("Failed to allocate memory in WindowData() ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ void FIRFilterWindow(double *FIRCoeff, int N, TWindowType WindowType,
|
|||||||
Beta = 10.0;
|
Beta = 10.0;
|
||||||
|
|
||||||
WinCoeff = new double[N + 2];
|
WinCoeff = new double[N + 2];
|
||||||
if (WinCoeff == NULL) {
|
if (WinCoeff == 0) {
|
||||||
// ShowMessage("Failed to allocate memory in WindowData() ");
|
// ShowMessage("Failed to allocate memory in WindowData() ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -365,7 +365,7 @@ void AdjustDelay(double *FirCoeff, int NumTaps, double Delay) {
|
|||||||
|
|
||||||
FFTInputR = new double[FFTSize]; // Real part
|
FFTInputR = new double[FFTSize]; // Real part
|
||||||
FFTInputI = new double[FFTSize]; // Imag part
|
FFTInputI = new double[FFTSize]; // Imag part
|
||||||
if (FFTInputR == NULL || FFTInputI == NULL) {
|
if (FFTInputR == 0 || FFTInputI == 0) {
|
||||||
//ShowMessage("Unable to allocate memory in AdjustDelay");
|
//ShowMessage("Unable to allocate memory in AdjustDelay");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,8 @@ int PFiftyOne(long double *Coeff, int Degree, long double *RealRoot,
|
|||||||
QuadK = new (std::nothrow) long double[N + 2];
|
QuadK = new (std::nothrow) long double[N + 2];
|
||||||
RealK = new (std::nothrow) long double[N + 2];
|
RealK = new (std::nothrow) long double[N + 2];
|
||||||
QK = new (std::nothrow) long double[N + 2];
|
QK = new (std::nothrow) long double[N + 2];
|
||||||
if (P == NULL || QuadQP == NULL || RealQP == NULL || QuadK == NULL
|
if (P == 0 || QuadQP == 0 || RealQP == 0 || QuadK == 0
|
||||||
|| RealK == NULL || QK == NULL) {
|
|| RealK == 0 || QK == 0) {
|
||||||
//ShowMessage("Memory not Allocated in PFiftyOne root finder.");
|
//ShowMessage("Memory not Allocated in PFiftyOne root finder.");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -606,7 +606,7 @@ void SetTUVandK(long double *P, int N, long double *TUV, long double *RealK,
|
|||||||
if (TypeOfQuadK == 0) // Init QuadK 2nd derivative of P
|
if (TypeOfQuadK == 0) // Init QuadK 2nd derivative of P
|
||||||
{
|
{
|
||||||
long double *Temp = new (std::nothrow) long double[N + 2];
|
long double *Temp = new (std::nothrow) long double[N + 2];
|
||||||
if (Temp == NULL) {
|
if (Temp == 0) {
|
||||||
//ShowMessage("Memory not Allocated in PFiftyOne SetTUVandK.");
|
//ShowMessage("Memory not Allocated in PFiftyOne SetTUVandK.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user