mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-05 02:58:37 -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];
|
||||
RevBits = new int[N];
|
||||
|
||||
if (BufferR == NULL || BufferI == NULL || TwiddleR == NULL
|
||||
|| TwiddleI == NULL || RevBits == NULL) {
|
||||
if (BufferR == 0 || BufferI == 0 || TwiddleR == 0
|
||||
|| TwiddleI == 0 || RevBits == 0) {
|
||||
// ShowMessage("FFT Memory Allocation Error");
|
||||
return;
|
||||
}
|
||||
@ -339,8 +339,8 @@ void DFT(double *InputR, double *InputI, int N, int Type) {
|
||||
TwiddleReal = new double[N];
|
||||
TwiddleImag = new double[N];
|
||||
|
||||
if (SumR == NULL || SumI == NULL || TwiddleReal == NULL
|
||||
|| TwiddleImag == NULL || (Type != FORWARD && Type != INVERSE)) {
|
||||
if (SumR == 0 || SumI == 0 || TwiddleReal == 0
|
||||
|| TwiddleImag == 0 || (Type != FORWARD && Type != INVERSE)) {
|
||||
// ShowMessage("Incorrect DFT Type or unable to allocate memory");
|
||||
return;
|
||||
}
|
||||
@ -398,7 +398,7 @@ void RealSigDFT(double *Samples, double *OutputR, double *OutputI, int N) {
|
||||
|
||||
TwiddleReal = new double[N];
|
||||
TwiddleImag = new double[N];
|
||||
if (TwiddleReal == NULL || TwiddleImag == NULL) {
|
||||
if (TwiddleReal == 0 || TwiddleImag == 0) {
|
||||
// ShowMessage("Failed to allocate memory in RealSigDFT");
|
||||
return;
|
||||
}
|
||||
@ -579,7 +579,7 @@ void WindowData(double *Data, int N, TWindowType WindowType, double Alpha,
|
||||
Beta = 10.0;
|
||||
|
||||
WinCoeff = new double[N + 2];
|
||||
if (WinCoeff == NULL) {
|
||||
if (WinCoeff == 0) {
|
||||
// ShowMessage("Failed to allocate memory in WindowData() ");
|
||||
return;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ void FIRFilterWindow(double *FIRCoeff, int N, TWindowType WindowType,
|
||||
Beta = 10.0;
|
||||
|
||||
WinCoeff = new double[N + 2];
|
||||
if (WinCoeff == NULL) {
|
||||
if (WinCoeff == 0) {
|
||||
// ShowMessage("Failed to allocate memory in WindowData() ");
|
||||
return;
|
||||
}
|
||||
@ -365,7 +365,7 @@ void AdjustDelay(double *FirCoeff, int NumTaps, double Delay) {
|
||||
|
||||
FFTInputR = new double[FFTSize]; // Real part
|
||||
FFTInputI = new double[FFTSize]; // Imag part
|
||||
if (FFTInputR == NULL || FFTInputI == NULL) {
|
||||
if (FFTInputR == 0 || FFTInputI == 0) {
|
||||
//ShowMessage("Unable to allocate memory in AdjustDelay");
|
||||
return;
|
||||
}
|
||||
|
@ -87,8 +87,8 @@ int PFiftyOne(long double *Coeff, int Degree, long double *RealRoot,
|
||||
QuadK = new (std::nothrow) long double[N + 2];
|
||||
RealK = new (std::nothrow) long double[N + 2];
|
||||
QK = new (std::nothrow) long double[N + 2];
|
||||
if (P == NULL || QuadQP == NULL || RealQP == NULL || QuadK == NULL
|
||||
|| RealK == NULL || QK == NULL) {
|
||||
if (P == 0 || QuadQP == 0 || RealQP == 0 || QuadK == 0
|
||||
|| RealK == 0 || QK == 0) {
|
||||
//ShowMessage("Memory not Allocated in PFiftyOne root finder.");
|
||||
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
|
||||
{
|
||||
long double *Temp = new (std::nothrow) long double[N + 2];
|
||||
if (Temp == NULL) {
|
||||
if (Temp == 0) {
|
||||
//ShowMessage("Memory not Allocated in PFiftyOne SetTUVandK.");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user