kopia lustrzana https://github.com/jamescoxon/dl-fldigi
rodzic
ab422bb9b1
commit
af77a5292a
|
@ -322,53 +322,98 @@ void dspFitPoly2(double Data[3], double &A, double &B, double &C);
|
|||
template <class type>
|
||||
int dspSelFitAver(type *Data, int Len, double SelThres, int Loops,
|
||||
double &Aver, double &dspRMS, int &Sel)
|
||||
{ int i,loop,Incl,prev; double Sum,ErrSum,Lev,dLev,Diff,Thres;
|
||||
for(ErrSum=Sum=0.0,i=0; i<Len; i++)
|
||||
{ Sum+=Data[i]; ErrSum+=dspPower(Data[i]); }
|
||||
Lev=Sum/Len; ErrSum/=Len; ErrSum-=Lev*Lev;
|
||||
// printf("Len=%d, Lev=%+7.4f, ErrSum=%7.4f, dspRMS=%7.4f\n",
|
||||
// Len,Lev,ErrSum,sqrt(ErrSum));
|
||||
for(Incl=0,prev=Len,loop=0; loop<Loops; loop++)
|
||||
{ Thres=SelThres*SelThres*ErrSum;
|
||||
for(ErrSum=Sum=0.0,Incl=0,i=0; i<Len; i++)
|
||||
{ Diff=dspPower(Data[i]-Lev);
|
||||
if(Diff<=Thres) { Sum+=Data[i]; ErrSum+=Diff; Incl+=1; }
|
||||
// else printf(" %d",i);
|
||||
} Sum/=Incl; dLev=Sum-Lev; ErrSum/=Incl;
|
||||
ErrSum-=dLev*dLev; Lev+=dLev; ErrSum=fabs(ErrSum);
|
||||
// printf("\nLoop #%d, Lev=%+7.4f, dLev=%+7.4f, ErrSum=%7.4f, dspRMS=%7.4f, Incl=%d\n",
|
||||
// loop,Lev,dLev,ErrSum,sqrt(ErrSum),Incl);
|
||||
// if(Incl==prev) { loop++; break; }
|
||||
// prev=Incl;
|
||||
} Aver=Lev; dspRMS=sqrt(ErrSum); Sel=Incl;
|
||||
return loop;
|
||||
{
|
||||
int i, loop, Incl;//, prev;
|
||||
double Sum, ErrSum, Lev, dLev, Diff, Thres;
|
||||
for (ErrSum = Sum = 0.0, i = 0; i < Len; i++) {
|
||||
Sum += Data[i];
|
||||
ErrSum += dspPower(Data[i]);
|
||||
}
|
||||
Lev = Sum/Len;
|
||||
ErrSum /= Len;
|
||||
ErrSum -= Lev*Lev;
|
||||
// printf("Len=%d, Lev=%+7.4f, ErrSum=%7.4f, dspRMS=%7.4f\n",
|
||||
// Len,Lev,ErrSum,sqrt(ErrSum));
|
||||
// prev = Len;
|
||||
Incl = 0;
|
||||
for (loop = 0; loop < Loops; loop++) {
|
||||
Thres = SelThres * SelThres * ErrSum;
|
||||
for (ErrSum = Sum = 0.0, Incl = 0, i = 0; i < Len; i++) {
|
||||
Diff = dspPower(Data[i]-Lev);
|
||||
if (Diff <= Thres) {
|
||||
Sum += Data[i];
|
||||
ErrSum += Diff;
|
||||
Incl += 1;
|
||||
}
|
||||
// else printf(" %d",i);
|
||||
}
|
||||
Sum /= Incl;
|
||||
dLev = Sum - Lev;
|
||||
ErrSum /= Incl;
|
||||
ErrSum -= dLev * dLev;
|
||||
Lev += dLev;
|
||||
ErrSum = fabs(ErrSum);
|
||||
// printf("\nLoop #%d, Lev=%+7.4f, dLev=%+7.4f, ErrSum=%7.4f, dspRMS=%7.4f, Incl=%d\n",
|
||||
// loop,Lev,dLev,ErrSum,sqrt(ErrSum),Incl);
|
||||
// if(Incl==prev) { loop++; break; }
|
||||
// prev=Incl;
|
||||
}
|
||||
Aver = Lev;
|
||||
dspRMS = sqrt(ErrSum);
|
||||
Sel=Incl;
|
||||
return loop;
|
||||
}
|
||||
|
||||
template <class type>
|
||||
int dspSelFitAver(Cdspcmpx<type> *Data, int Len, double SelThres, int Loops,
|
||||
int dspSelFitAver(Cdspcmpx<type> *Data, int Len, double SelThres, int Loops,
|
||||
Cdspcmpx<double> &Aver, double &dspRMS, int &Sel)
|
||||
{ int i,loop,Incl,prev; dspCmpx Sum,Lev,dLev; double ErrSum,Diff,Thres;
|
||||
for(ErrSum=0.0,Sum.re=Sum.im=0.0,i=0; i<Len; i++)
|
||||
{ Sum.re+=Data[i].re; Sum.im+=Data[i].im; ErrSum+=dspPower(Data[i]); }
|
||||
Lev.re=Sum.re/Len; Lev.im=Sum.im/Len; ErrSum/=Len; ErrSum-=dspPower(Lev);
|
||||
// printf("Len=%d, Lev=[%+7.4f,%+7.4f], ErrSum=%7.4f, dspRMS=%7.4f\n",
|
||||
// Len,Lev.re,Lev.im,ErrSum,sqrt(ErrSum));
|
||||
for(Incl=0,prev=Len,loop=0; loop<Loops; loop++)
|
||||
{ Thres=0.5*SelThres*SelThres*ErrSum;
|
||||
for(ErrSum=0.0,Sum.re=Sum.im=0.0,Incl=0,i=0; i<Len; i++)
|
||||
{ Diff=dspPower(Data[i].re-Lev.re,Data[i].im-Lev.im);
|
||||
if(Diff<=Thres) { Sum.re+=Data[i].re; Sum.im+=Data[i].im; ErrSum+=Diff; Incl+=1; }
|
||||
// else printf(" %d",i);
|
||||
} Sum.re/=Incl; Sum.im/=Incl;
|
||||
dLev.re=Sum.re-Lev.re; dLev.im=Sum.im-Lev.im;
|
||||
ErrSum/=Incl; ErrSum-=dspPower(dLev); ErrSum=fabs(ErrSum);
|
||||
Lev.re+=dLev.re; Lev.im+=dLev.im;
|
||||
// printf("\nLoop #%d, Lev=[%+6.3f,%+6.3f], dLev=[%+6.3f,%+6.3f], ErrSum=%7.4f, dspRMS=%7.4f, Incl=%d\n",
|
||||
// loop, Lev.re,Lev.im, dLev.re,dLev.im, ErrSum,sqrt(ErrSum), Incl);
|
||||
// if(Incl==prev) { loop++; break; }
|
||||
// prev=Incl;
|
||||
} Aver=Lev; dspRMS=sqrt(ErrSum); Sel=Incl;
|
||||
return loop;
|
||||
{
|
||||
int i, loop, Incl;//, prev;
|
||||
dspCmpx Sum, Lev, dLev;
|
||||
double ErrSum, Diff, Thres;
|
||||
for (ErrSum = 0.0, Sum.re = Sum.im = 0.0, i = 0; i < Len; i++) {
|
||||
Sum.re += Data[i].re;
|
||||
Sum.im += Data[i].im;
|
||||
ErrSum += dspPower(Data[i]);
|
||||
}
|
||||
Lev.re = Sum.re / Len;
|
||||
Lev.im = Sum.im / Len;
|
||||
ErrSum /= Len;
|
||||
ErrSum -= dspPower(Lev);
|
||||
// printf("Len=%d, Lev=[%+7.4f,%+7.4f], ErrSum=%7.4f, dspRMS=%7.4f\n",
|
||||
// Len,Lev.re,Lev.im,ErrSum,sqrt(ErrSum));
|
||||
Incl = 0;
|
||||
// prev = Len;
|
||||
for (loop = 0; loop < Loops; loop++) {
|
||||
Thres = 0.5 * SelThres * SelThres * ErrSum;
|
||||
for (ErrSum = 0.0, Sum.re = Sum.im = 0.0, Incl = 0, i = 0; i < Len; i++) {
|
||||
Diff = dspPower(Data[i].re - Lev.re, Data[i].im - Lev.im);
|
||||
if (Diff <= Thres) {
|
||||
Sum.re += Data[i].re;
|
||||
Sum.im += Data[i].im;
|
||||
ErrSum += Diff;
|
||||
Incl += 1;
|
||||
}
|
||||
// else printf(" %d",i);
|
||||
}
|
||||
Sum.re /= Incl;
|
||||
Sum.im /= Incl;
|
||||
dLev.re = Sum.re - Lev.re;
|
||||
dLev.im = Sum.im - Lev.im;
|
||||
ErrSum /= Incl;
|
||||
ErrSum -= dspPower(dLev);
|
||||
ErrSum = fabs(ErrSum);
|
||||
Lev.re += dLev.re;
|
||||
Lev.im += dLev.im;
|
||||
// printf("\nLoop #%d, Lev=[%+6.3f,%+6.3f], dLev=[%+6.3f,%+6.3f], ErrSum=%7.4f, dspRMS=%7.4f, Incl=%d\n",
|
||||
// loop, Lev.re,Lev.im, dLev.re,dLev.im, ErrSum,sqrt(ErrSum), Incl);
|
||||
// if(Incl==prev) { loop++; break; }
|
||||
// prev=Incl;
|
||||
}
|
||||
Aver = Lev;
|
||||
dspRMS = sqrt(ErrSum);
|
||||
Sel = Incl;
|
||||
return loop;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace core
|
|||
|
||||
//! Very simple string class with some useful features.
|
||||
/** string<c8> and string<wchar_t> work both with unicode AND ascii,
|
||||
so you can assign unicode to string<c8> and ascii to string<wchar_t>
|
||||
(and the other way round) if your ever would want to.
|
||||
so you can assign unicode to string<c8> and ascii to string<wchar_t>
|
||||
(and the other way round) if your ever would want to.
|
||||
Note that the conversation between both is not done using an encoding.
|
||||
|
||||
Known bugs:
|
||||
|
@ -62,11 +62,11 @@ public:
|
|||
|
||||
c8 tmpbuf[16];
|
||||
tmpbuf[15] = 0;
|
||||
s32 idx = 15;
|
||||
s32 idx = 15;
|
||||
|
||||
// special case '0'
|
||||
|
||||
if (!number)
|
||||
if (!number)
|
||||
{
|
||||
tmpbuf[14] = '0';
|
||||
*this = &tmpbuf[14];
|
||||
|
@ -77,9 +77,9 @@ public:
|
|||
|
||||
while(number && idx)
|
||||
{
|
||||
idx--;
|
||||
idx--;
|
||||
tmpbuf[idx] = (c8)('0' + (number % 10));
|
||||
number = number / 10;
|
||||
number = number / 10;
|
||||
}
|
||||
|
||||
// add sign
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
if (negative)
|
||||
{
|
||||
idx--;
|
||||
tmpbuf[idx] = '-';
|
||||
tmpbuf[idx] = '-';
|
||||
}
|
||||
|
||||
*this = &tmpbuf[idx];
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
|
||||
|
||||
//! Assignment operator
|
||||
string<T>& operator=(const string<T>& other)
|
||||
string<T>& operator=(const string<T>& other)
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
@ -153,7 +153,7 @@ public:
|
|||
|
||||
//! Assignment operator for strings, ascii and unicode
|
||||
template <class B>
|
||||
string<T>& operator=(const B* c)
|
||||
string<T>& operator=(const B* c)
|
||||
{
|
||||
if (!c)
|
||||
{
|
||||
|
@ -193,22 +193,22 @@ public:
|
|||
}
|
||||
|
||||
//! Add operator for other strings
|
||||
string<T> operator+(const string<T>& other)
|
||||
{
|
||||
string<T> str(*this);
|
||||
str.append(other);
|
||||
string<T> operator+(const string<T>& other)
|
||||
{
|
||||
string<T> str(*this);
|
||||
str.append(other);
|
||||
|
||||
return str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
//! Add operator for strings, ascii and unicode
|
||||
template <class B>
|
||||
string<T> operator+(const B* c)
|
||||
{
|
||||
string<T> str(*this);
|
||||
str.append(c);
|
||||
//! Add operator for strings, ascii and unicode
|
||||
template <class B>
|
||||
string<T> operator+(const B* c)
|
||||
{
|
||||
string<T> str(*this);
|
||||
str.append(c);
|
||||
|
||||
return str;
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//! Returns length of string
|
||||
/** \return Returns length of the string in characters. */
|
||||
s32 size() const
|
||||
|
@ -347,7 +347,7 @@ public:
|
|||
//! compares the first n characters of the strings
|
||||
bool equalsn(const T* str, int len)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
for(i=0; array[i] && str[i] && i < len; ++i)
|
||||
if (array[i] != str[i])
|
||||
return false;
|
||||
|
@ -378,7 +378,7 @@ public:
|
|||
--used;
|
||||
|
||||
s32 len = other.size();
|
||||
|
||||
|
||||
if (used + len + 1 > allocated)
|
||||
reallocate((s32)used + (s32)len + 1);
|
||||
|
||||
|
@ -404,7 +404,7 @@ public:
|
|||
|
||||
len = length;
|
||||
--used;
|
||||
|
||||
|
||||
if (used + len > allocated)
|
||||
reallocate((s32)used + (s32)len);
|
||||
|
||||
|
@ -442,7 +442,7 @@ public:
|
|||
//! finds first occurrence of a character of a list in string
|
||||
/** \param c: List of strings to find. For example if the method
|
||||
should find the first occurance of 'a' or 'b', this parameter should be "ab".
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
this should be strlen(ofParameter1)
|
||||
\return Returns position where one of the character has been found,
|
||||
or -1 if not found. */
|
||||
|
@ -460,11 +460,11 @@ public:
|
|||
//! Finds first position of a character not in a given list.
|
||||
/** \param c: List of characters not to find. For example if the method
|
||||
should find the first occurance of a character not 'a' or 'b', this parameter should be "ab".
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
this should be strlen(ofParameter1)
|
||||
\return Returns position where the character has been found,
|
||||
or -1 if not found. */
|
||||
template <class B>
|
||||
template <class B>
|
||||
s32 findFirstCharNotInList(B* c, int count) const
|
||||
{
|
||||
for (int i=0; i<used; ++i)
|
||||
|
@ -484,11 +484,11 @@ public:
|
|||
//! Finds last position of a character not in a given list.
|
||||
/** \param c: List of characters not to find. For example if the method
|
||||
should find the first occurance of a character not 'a' or 'b', this parameter should be "ab".
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
\param count: Amount of characters in the list. Ususally,
|
||||
this should be strlen(ofParameter1)
|
||||
\return Returns position where the character has been found,
|
||||
or -1 if not found. */
|
||||
template <class B>
|
||||
template <class B>
|
||||
s32 findLastCharNotInList(B* c, int count) const
|
||||
{
|
||||
for (int i=used-2; i>=0; --i)
|
||||
|
@ -507,7 +507,7 @@ public:
|
|||
|
||||
//! finds next occurrence of character in string
|
||||
/** \param c: Character to search for.
|
||||
\param startPos: Position in string to start searching.
|
||||
\param startPos: Position in string to start searching.
|
||||
\return Returns position where the character has been found,
|
||||
or -1 if not found. */
|
||||
s32 findNext(T c, s32 startPos) const
|
||||
|
@ -598,7 +598,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
//! Erases a character from the string. May be slow, because all elements
|
||||
//! Erases a character from the string. May be slow, because all elements
|
||||
//! following after the erased element have to be copied.
|
||||
//! \param index: Index of element to be erased.
|
||||
void erase(int index)
|
||||
|
@ -611,7 +611,7 @@ public:
|
|||
--used;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@ -631,14 +631,15 @@ private:
|
|||
|
||||
array = new T[new_size];
|
||||
allocated = new_size;
|
||||
|
||||
|
||||
s32 amount = used < new_size ? used : new_size;
|
||||
for (s32 i=0; i<amount; ++i)
|
||||
array[i] = old_array[i];
|
||||
|
||||
if (allocated < used)
|
||||
used = allocated;
|
||||
|
||||
// if (allocated < used)
|
||||
// used = allocated;
|
||||
used = amount;
|
||||
|
||||
delete [] old_array;
|
||||
}
|
||||
|
||||
|
|
|
@ -4121,7 +4121,7 @@ big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
|
|||
{
|
||||
if (n >= 2) {
|
||||
const Summary16 *summary = NULL;
|
||||
if (wc >= 0x0000 && wc < 0x0100)
|
||||
if (wc > 0x0000 && wc < 0x0100)
|
||||
summary = &big5_uni2indx_page00[(wc>>4)];
|
||||
else if (wc >= 0x0200 && wc < 0x0460)
|
||||
summary = &big5_uni2indx_page02[(wc>>4)-0x020];
|
||||
|
|
|
@ -88,7 +88,7 @@ cp1258_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
|
|||
if (last_wc) {
|
||||
if (wc >= 0x0300 && wc < 0x0340) {
|
||||
/* See whether last_wc and wc can be combined. */
|
||||
unsigned int k;
|
||||
unsigned int k = 0;
|
||||
unsigned int i1, i2;
|
||||
switch (wc) {
|
||||
case 0x0300: k = 0; break;
|
||||
|
|
|
@ -2536,7 +2536,7 @@ gb2312_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
|
|||
{
|
||||
if (n >= 2) {
|
||||
const Summary16 *summary = NULL;
|
||||
if (wc >= 0x0000 && wc < 0x0460)
|
||||
if (wc > 0x0000 && wc < 0x0460)
|
||||
summary = &gb2312_uni2indx_page00[(wc>>4)];
|
||||
else if (wc >= 0x2000 && wc < 0x2650)
|
||||
summary = &gb2312_uni2indx_page20[(wc>>4)-0x200];
|
||||
|
|
|
@ -2378,7 +2378,7 @@ jisx0208_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
|
|||
{
|
||||
if (n >= 2) {
|
||||
const Summary16 *summary = NULL;
|
||||
if (wc >= 0x0000 && wc < 0x0100)
|
||||
if (wc > 0x0000 && wc < 0x0100)
|
||||
summary = &jisx0208_uni2indx_page00[(wc>>4)];
|
||||
else if (wc >= 0x0300 && wc < 0x0460)
|
||||
summary = &jisx0208_uni2indx_page03[(wc>>4)-0x030];
|
||||
|
|
|
@ -251,7 +251,7 @@ active:
|
|||
return RET_TOOSMALL;
|
||||
if ((state & 3) >= 2) {
|
||||
unsigned int i = state & -4;
|
||||
unsigned char c;
|
||||
unsigned char c = 0;
|
||||
if (i < 26)
|
||||
c = i+'A';
|
||||
else if (i < 52)
|
||||
|
@ -289,7 +289,7 @@ active:
|
|||
return RET_TOOSMALL;
|
||||
for (;;) {
|
||||
unsigned int i;
|
||||
unsigned char c;
|
||||
unsigned char c = 0;
|
||||
switch (state & 3) {
|
||||
case 0: /* inside base64, 6 bits known for 4th byte */
|
||||
c = (state & -4) >> 2; state = 1; break;
|
||||
|
@ -337,7 +337,7 @@ utf7_reset (conv_t conv, unsigned char *r, int n)
|
|||
return RET_TOOSMALL;
|
||||
if ((state & 3) >= 2) {
|
||||
unsigned int i = state & -4;
|
||||
unsigned char c;
|
||||
unsigned char c = 0;
|
||||
if (i < 26)
|
||||
c = i+'A';
|
||||
else if (i < 52)
|
||||
|
|
|
@ -188,7 +188,6 @@ void cAdifIO::do_readfile(const char *fname, cQsoDb *db)
|
|||
long filesize = 0;
|
||||
char *buff;
|
||||
int found;
|
||||
int retval;
|
||||
|
||||
// open the adif file
|
||||
FILE *adiFile = fopen (fname, "r");
|
||||
|
@ -216,8 +215,12 @@ void cAdifIO::do_readfile(const char *fname, cQsoDb *db)
|
|||
// read the entire file into the buffer
|
||||
|
||||
fseek (adiFile, 0, SEEK_SET);
|
||||
retval = fread (buff, filesize, 1, adiFile);
|
||||
int retval = fread (buff, filesize, 1, adiFile);
|
||||
fclose (adiFile);
|
||||
if (retval != 1) {
|
||||
LOG_ERROR(_("Error reading %s"), fl_filename_name(fname));
|
||||
return;
|
||||
}
|
||||
|
||||
// relaxed file integrity test to all importing from non conforming log programs
|
||||
if (strcasestr(buff, "<CALL:") == 0) {
|
||||
|
|
|
@ -854,10 +854,8 @@ static void pDECR(std::string &s, size_t &i, size_t endbracket)
|
|||
s.replace(i, endbracket - i + 1, "");
|
||||
return;
|
||||
}
|
||||
int contestval;
|
||||
contest_count.count--;
|
||||
if (contest_count.count < 0) contest_count.count = 0;
|
||||
contestval = contest_count.count;
|
||||
s.replace (i, 6, "");
|
||||
updateOutSerNo();
|
||||
}
|
||||
|
@ -868,9 +866,7 @@ static void pINCR(std::string &s, size_t &i, size_t endbracket)
|
|||
s.replace(i, endbracket - i + 1, "");
|
||||
return;
|
||||
}
|
||||
int contestval;
|
||||
contest_count.count++;
|
||||
contestval = contest_count.count;
|
||||
s.replace (i, 6, "");
|
||||
updateOutSerNo();
|
||||
}
|
||||
|
@ -2168,7 +2164,6 @@ int MACROTEXT::loadMacros(const std::string& filename)
|
|||
std::string mLine;
|
||||
std::string mName;
|
||||
std::string mDef;
|
||||
bool inMacro = false;
|
||||
int mNumber = 0;
|
||||
unsigned long int crlf; // 64 bit cpu's
|
||||
char szLine[4096];
|
||||
|
@ -2195,7 +2190,6 @@ int MACROTEXT::loadMacros(const std::string& filename)
|
|||
name[i] = "";
|
||||
text[i] = "";
|
||||
}
|
||||
inMacro = false;
|
||||
while (!mFile.eof()) {
|
||||
mFile.getline(szLine,4095);
|
||||
mLine = szLine;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <outputencoder.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "debug.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -77,14 +78,22 @@ void OutputEncoder::push(string s)
|
|||
int available = buffer_size - (encoding_ptr - buffer);
|
||||
int consumed_in;
|
||||
int consumed_out;
|
||||
int status;
|
||||
|
||||
status = tiniconv_convert(&ctx,
|
||||
|
||||
int status = tiniconv_convert(&ctx,
|
||||
(unsigned char*)s.data(), s.length(), &consumed_in,
|
||||
encoding_ptr, available, &consumed_out);
|
||||
if (status != TINICONV_CONVERT_OK) {
|
||||
LOG_ERROR("Error %s",
|
||||
status == TINICONV_CONVERT_IN_TOO_SMALL ? "input too small" :
|
||||
status == TINICONV_CONVERT_OUT_TOO_SMALL ? "output too small" :
|
||||
status == TINICONV_CONVERT_IN_ILSEQ ? "input illegal sequence" :
|
||||
status == TINICONV_CONVERT_OUT_ILSEQ ? "output illegal sequence" :
|
||||
"unknown error");
|
||||
return;
|
||||
}
|
||||
|
||||
encoding_ptr += consumed_out;
|
||||
|
||||
|
||||
if (consumed_in < (int)s.length())
|
||||
{
|
||||
// All input data was not consumed, possibly because the
|
||||
|
@ -93,7 +102,7 @@ void OutputEncoder::push(string s)
|
|||
memmove(buffer, pop_ptr, buffer + buffer_size - pop_ptr);
|
||||
encoding_ptr -= (pop_ptr - buffer);
|
||||
pop_ptr = buffer;
|
||||
|
||||
|
||||
// Now try again; fingers crossed. We don't check for
|
||||
// success anymore, because there is nothing that we can do
|
||||
// if the buffer is still too small.
|
||||
|
@ -115,9 +124,9 @@ const unsigned int OutputEncoder::pop(void)
|
|||
{
|
||||
if (pop_ptr == encoding_ptr)
|
||||
return(-1);
|
||||
|
||||
|
||||
unsigned int c = *pop_ptr++;
|
||||
|
||||
|
||||
// Note that by only advancing pop_ptr, we leave stale data at the
|
||||
// beginning of the buffer, so sooner or later it will clutter up.
|
||||
// If there is no data left to send, both encoding_ptr and pop_ptr
|
||||
|
|
|
@ -1029,7 +1029,8 @@ void MT63rx::SyncProcess(dspCmpx *Slice)
|
|||
dspCmpx SymbTime;
|
||||
double SymbConf, SymbShift, FreqOfs;
|
||||
double dspRMS;
|
||||
int Loops, Incl;
|
||||
// int Loops;
|
||||
int Incl;
|
||||
|
||||
SyncPtr = (SyncPtr + 1) & (SymbolDiv - 1); // increment the correlators pointer
|
||||
|
||||
|
@ -1240,7 +1241,8 @@ void MT63rx::SyncProcess(dspCmpx *Slice)
|
|||
FreqPipe[TrackPipePtr] = FreqOfs; // for averaging
|
||||
|
||||
// find dspAverage symbol time
|
||||
Loops = dspSelFitAver( SymbPipe,
|
||||
// Loops =
|
||||
dspSelFitAver( SymbPipe,
|
||||
TrackPipeLen,
|
||||
(double)3.0,
|
||||
4,
|
||||
|
@ -1250,7 +1252,8 @@ void MT63rx::SyncProcess(dspCmpx *Slice)
|
|||
// printf(" AverSymb=[%+5.2f,%+5.2f], dspRMS=%5.3f/%2d",
|
||||
// AverSymb.re,AverSymb.im,dspRMS,Incl);
|
||||
// find dspAverage freq. offset
|
||||
Loops = dspSelFitAver( FreqPipe,
|
||||
// Loops =
|
||||
dspSelFitAver( FreqPipe,
|
||||
TrackPipeLen,
|
||||
(double)2.5,
|
||||
4,
|
||||
|
|
|
@ -55,8 +55,6 @@ double olivia::nco(double freq)
|
|||
|
||||
void olivia::tx_init(SoundBase *sc)
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
scard = sc;
|
||||
phaseacc = 0;
|
||||
prevsymbol = complex (1.0, 0.0);
|
||||
|
|
|
@ -198,8 +198,8 @@ void hamlib_init_defaults()
|
|||
bool hamlib_init(bool bPtt)
|
||||
{
|
||||
freq_t freq;
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
// rmode_t mode;
|
||||
// pbwidth_t width;
|
||||
|
||||
hamlib_ptt = bPtt;
|
||||
|
||||
|
@ -311,7 +311,7 @@ bool hamlib_init(bool bPtt)
|
|||
if ( !xcvr->canGetMode() ) need_mode = false;
|
||||
else {
|
||||
need_mode = true;
|
||||
mode = xcvr->getMode(width);
|
||||
// mode = xcvr->getMode(width);
|
||||
}
|
||||
}
|
||||
catch (const RigException& Ex) {
|
||||
|
|
|
@ -501,14 +501,12 @@ int WFdisp::log2disp(int v)
|
|||
}
|
||||
|
||||
void WFdisp::processFFT() {
|
||||
int ptrSample;
|
||||
if (prefilter != progdefaults.wfPreFilter)
|
||||
setPrefilter(progdefaults.wfPreFilter);
|
||||
|
||||
const double scale = ( (double)SC_SMPLRATE / srate ) * ( FFT_LEN / 2000.0 );
|
||||
|
||||
if (dispcnt == 0) {
|
||||
ptrSample = ptrCB;
|
||||
int step = 8 / progdefaults.latency;
|
||||
|
||||
int last_i = FFT_LEN * 2 / step;
|
||||
|
@ -564,11 +562,11 @@ FL_UNLOCK_D();
|
|||
--dispcnt;
|
||||
}
|
||||
void WFdisp::process_analog (double *sig, int len) {
|
||||
int h1, h2, h3, sigw, sigy, sigpixel, ynext, graylevel;
|
||||
int h1, h2, h3;
|
||||
int sigy, sigpixel, ynext, graylevel;
|
||||
h1 = h()/8 - 1;
|
||||
h2 = h()/2 - 1;
|
||||
h3 = h()*7/8 + 1;
|
||||
sigw = IMAGE_WIDTH;
|
||||
graylevel = 220;
|
||||
// clear the signal display area
|
||||
sigy = 0;
|
||||
|
|
|
@ -996,7 +996,7 @@ public:
|
|||
}
|
||||
|
||||
double tmpCorrPrev = correlation_from_index(corr_smpl_lin, 0 );
|
||||
double tmpCorrMax = 0.0 ;
|
||||
// double tmpCorrMax = 0.0 ;
|
||||
size_t local_max = 0 ;
|
||||
bool is_growing = false ;
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ public:
|
|||
bool is_growing_next = tmpCorr > tmpCorrPrev ;
|
||||
if( is_growing && ( ! is_growing_next ) ) {
|
||||
local_max = i - 1 ;
|
||||
tmpCorrMax = tmpCorr ;
|
||||
// tmpCorrMax = tmpCorr ;
|
||||
break ;
|
||||
}
|
||||
is_growing = is_growing_next ;
|
||||
|
|
|
@ -824,7 +824,7 @@ void Fl_Text_Display_mod::overstrike(const char* text) {
|
|||
int Fl_Text_Display_mod::position_to_xy( int pos, int* X, int* Y ) const {
|
||||
IS_UTF8_ALIGNED2(buffer(), pos)
|
||||
|
||||
int lineStartPos, fontHeight, lineLen;
|
||||
int lineStartPos, fontHeight;//, lineLen;
|
||||
int visLineNum;
|
||||
|
||||
/* If position is not displayed, return false */
|
||||
|
@ -851,7 +851,7 @@ int Fl_Text_Display_mod::position_to_xy( int pos, int* X, int* Y ) const {
|
|||
*X = text_area.x - mHorizOffset;
|
||||
return 1;
|
||||
}
|
||||
lineLen = vline_length( visLineNum );
|
||||
// lineLen = vline_length( visLineNum );
|
||||
*X = text_area.x + handle_vline(GET_WIDTH, lineStartPos, pos-lineStartPos, 0, 0, 0, 0, 0, 0) - mHorizOffset;
|
||||
return 1;
|
||||
}
|
||||
|
@ -2984,7 +2984,8 @@ void Fl_Text_Display_mod::measure_deleted_lines(int pos, int nDeleted) {
|
|||
int nVisLines = mNVisibleLines;
|
||||
int *lineStarts = mLineStarts;
|
||||
int countFrom, lineStart;
|
||||
int visLineNum = 0, nLines = 0, i;
|
||||
// int visLineNum = 0;
|
||||
int nLines = 0, i;
|
||||
/*
|
||||
** Determine where to begin searching: either the previous newline, or
|
||||
** if possible, limit to the start of the (original) previous displayed
|
||||
|
@ -2996,7 +2997,7 @@ void Fl_Text_Display_mod::measure_deleted_lines(int pos, int nDeleted) {
|
|||
break;
|
||||
if (i > 0) {
|
||||
countFrom = lineStarts[i-1];
|
||||
visLineNum = i-1;
|
||||
// visLineNum = i-1;
|
||||
} else
|
||||
countFrom = buf->line_start(pos);
|
||||
} else
|
||||
|
|
|
@ -43,7 +43,7 @@ void Progress::draw()
|
|||
int progress; // Size of progress bar...
|
||||
int bx, by, bw, bh; // Box areas...
|
||||
int tx, tw; // Temporary X + width
|
||||
int th; // Temporary Y + height
|
||||
int th;
|
||||
|
||||
|
||||
// Get the box borders...
|
||||
|
|
Ładowanie…
Reference in New Issue