author | erik <erik> | 2007-01-29 21:53:48 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-29 21:53:48 (UTC) |
commit | 02ef45be75a3024df11365956e1cce6392d9103c (patch) (side-by-side diff) | |
tree | 42fd5c909d67a473f57a607e01d32e01b3dd2511 | |
parent | b2c306a99b8dc82c981390f02db859149fac8cf0 (diff) | |
download | opie-02ef45be75a3024df11365956e1cce6392d9103c.zip opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.gz opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.bz2 |
Each file in this commit has an issue where the initial value of a variable
is assumed to be something but no initial value is given.
This commit changes that by either assigning an initial value or removing
the assumption on an initial value (usually the former).
-rw-r--r-- | libopie2/opiecore/device/odevice_htc.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiepim/private/opimeventsortvector.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/confedit/listviewitemconffile.cpp | 59 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-reader/CFilter.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-reader/CRegExp.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-reader/Palm2QImage.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-reader/QTReader.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-reader/plucker_base.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-reader/striphtml.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katehighlight.cpp | 10 | ||||
-rw-r--r-- | noncore/net/ftplib/ftplib.c | 2 | ||||
-rw-r--r-- | noncore/settings/sysinfo/contrib/dhry.c | 2 |
14 files changed, 56 insertions, 56 deletions
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp index c21e10d..4e5200b 100644 --- a/libopie2/opiecore/device/odevice_htc.cpp +++ b/libopie2/opiecore/device/odevice_htc.cpp @@ -422,3 +422,3 @@ Transformation HTC::rotation() const qDebug( "HTC::rotation()" ); - Transformation rot; + Transformation rot = Rot270; @@ -431,3 +431,2 @@ Transformation HTC::rotation() const else if ( hs == CASE_UNKNOWN ) rot = Rot270; - else rot = Rot270; } diff --git a/libopie2/opiepim/private/opimeventsortvector.cpp b/libopie2/opiepim/private/opimeventsortvector.cpp index 4220c63..b85f848 100644 --- a/libopie2/opiepim/private/opimeventsortvector.cpp +++ b/libopie2/opiepim/private/opimeventsortvector.cpp @@ -39,5 +39,3 @@ namespace Internal { -namespace{ - -inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPimNotifyManager& rightnotifiers ){ +int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPimNotifyManager& rightnotifiers ){ OPimNotifyManager::Alarms left_alarms = leftnotifiers.alarms(); @@ -62,3 +60,3 @@ inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPi - int ret; + int ret = 0; @@ -69,3 +67,3 @@ inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPi if ( left_earliest.isValid() && right_earliest.isValid() ){ - ret += left_earliest < right_earliest ? -1 : 1; + left_earliest < right_earliest ? ret-- : ret++; } @@ -75,3 +73,2 @@ inline int testAlarmNotifiers( const OPimNotifyManager& leftnotifiers, const OPi } -} diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 2958cf5..a7d6b00 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp @@ -43,3 +43,3 @@ QString ListViewItemConfFile::fileName() { - return confFileInfo->fileName(); + return confFileInfo->fileName(); } @@ -48,10 +48,11 @@ void ListViewItemConfFile::parseFile() { - //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl; - QFile confFile(confFileInfo->absFilePath()); - if(! confFile.open(IO_ReadOnly)) - QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); - QTextStream t( &confFile ); - QString s; + //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl; + QFile confFile(confFileInfo->absFilePath()); + if(! confFile.open(IO_ReadOnly)) + QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); + + QTextStream t( &confFile ); + QString s; QString group; - ListViewItemConfigEntry *groupItem; + ListViewItemConfigEntry *groupItem = 0; ListViewItemConfigEntry *item; @@ -59,22 +60,26 @@ void ListViewItemConfFile::parseFile() { - s = t.readLine().stripWhiteSpace(); - //odebug << "line: >" << s.latin1() << "<\n" << oendl; - if (s.contains("<?xml")) - { - _valid = false; - break; - }else - if ( s[0] == '[' && s[s.length()-1] == ']' ) - { - // odebug << "got group"+s << oendl; + s = t.readLine().stripWhiteSpace(); + //odebug << "line: >" << s.latin1() << "<\n" << oendl; + if (s.contains("<?xml")) + { + _valid = false; + break; + } + else if ( s[0] == '[' && s[s.length()-1] == ']' ) + { + //odebug << "got group"+s << oendl; group = s.mid(1,s.length()-2); - if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); + if (!groupItem) + groupItem = new ListViewItemConfigEntry(this, tr("no group") ); + groupItem = new ListViewItemConfigEntry(this, group ); insertItem( groupItem ); - } else - if ( int pos = s.find('=') ) + } + else if ( int pos = s.find('=') ) { -// odebug << "got key"+s << oendl; - if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl; - item = new ListViewItemConfigEntry(this, group, s ); + //odebug << "got key"+s << oendl; + if (!groupItem) + odebug << "PANIC! no group >" << group.latin1() << "<" << oendl; + + item = new ListViewItemConfigEntry(this, group, s ); groupItem->insertItem( item ); @@ -82,5 +87,5 @@ void ListViewItemConfFile::parseFile() } - confFile.close(); - setExpandable( _valid ); -// odebug << "ListViewItemConfFile::parseFile END" << oendl; + confFile.close(); + setExpandable( _valid ); + //odebug << "ListViewItemConfFile::parseFile END" << oendl; } diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 9d27c85..a0f72ae 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp @@ -37,2 +37,3 @@ bool IOIrda::open() { m_attach = 0l; + ret = false; } diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index aba7244..a884179 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -709,3 +709,3 @@ void MainWindow::slotScrollbarSelected(int index) { - int loc; + int loc = 0; @@ -713,7 +713,3 @@ void MainWindow::slotScrollbarSelected(int index) cfg.setGroup("ScrollBar"); - if(index == sm_none) - { - loc = 0; - } - else if(index == sm_left) + if(index == sm_left) { @@ -726,3 +722,3 @@ void MainWindow::slotScrollbarSelected(int index) - cfg.writeEntry("Position", loc); + cfg.writeEntry("Position", loc); diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index 25cdfae..a4ea60a 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp @@ -503,3 +503,3 @@ void DePluck::getch(tchar& ch, CStyle& sty, unsigned long& pos) } - unsigned long lnk, lnkoff; + unsigned long lnk = 0, lnkoff = 0; do diff --git a/noncore/apps/opie-reader/CRegExp.cpp b/noncore/apps/opie-reader/CRegExp.cpp index 6318d28..e3194df 100644 --- a/noncore/apps/opie-reader/CRegExp.cpp +++ b/noncore/apps/opie-reader/CRegExp.cpp @@ -111,3 +111,3 @@ void CRegExpFilt::prepreprocessing(const QString& pat, bool insens) { - tchar clast; + tchar clast = 0; bool invert = false; @@ -289,3 +289,3 @@ unsigned int CRegExpFilt::preprocessing(const QString& pat, bool insens) { - tchar c, clast; + tchar c, clast = 0; bool invert = false; diff --git a/noncore/apps/opie-reader/Palm2QImage.cpp b/noncore/apps/opie-reader/Palm2QImage.cpp index 361755f..09cad1c 100644 --- a/noncore/apps/opie-reader/Palm2QImage.cpp +++ b/noncore/apps/opie-reader/Palm2QImage.cpp @@ -127,3 +127,3 @@ QImage* Palm2QImage unsigned int palm_red_bits, palm_green_bits, palm_blue_bits; - unsigned char *palm_ptr, *x_ptr, *imagedata, *inbyte, *rowbuf, *lastrow, + unsigned char *palm_ptr, *x_ptr, *inbyte, *rowbuf, *lastrow, *imagedatastart, *palmimage; @@ -215,3 +215,3 @@ QImage* Palm2QImage - for (i=0, palm_ptr = imagedatastart , x_ptr = imagedata; i < height; ++i) { + for (i=0, palm_ptr = imagedatastart , x_ptr = 0; i < height; ++i) { // qDebug("inval:%x palm_ptr:%x x_ptr:%x bpr:%x", inval, palm_ptr, x_ptr, bytes_per_row); diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp index 0c56dd4..75da8ac 100644 --- a/noncore/apps/opie-reader/QTReader.cpp +++ b/noncore/apps/opie-reader/QTReader.cpp @@ -546,3 +546,3 @@ void QTReader::processmousewordevent(size_t startpos, size_t startoffset, QMouse { - unsigned long wrdstart, wrdend; + unsigned long wrdstart = 0, wrdend = 0; QString wrd; diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp index 849edfc..302ac73 100644 --- a/noncore/apps/opie-reader/plucker_base.cpp +++ b/noncore/apps/opie-reader/plucker_base.cpp @@ -707,3 +707,3 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen) { - unsigned short sz; + unsigned short sz = 0; if (srclen >= sizeof(sz)) diff --git a/noncore/apps/opie-reader/striphtml.cpp b/noncore/apps/opie-reader/striphtml.cpp index c434dbb..a2ad56b 100644 --- a/noncore/apps/opie-reader/striphtml.cpp +++ b/noncore/apps/opie-reader/striphtml.cpp @@ -475,3 +475,3 @@ linkType striphtml::hyperlink(unsigned int n, unsigned int, QString& w, QString& QString fc = currentfile; - unsigned long loc; + unsigned long loc = 0; htmlmark m(fc, loc); diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp index 89024f7..ee6030f 100644 --- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp +++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp @@ -1318,3 +1318,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { ItemStyleList defaultStyleList; - ItemStyle *defaultStyle; + ItemStyle *defaultStyle = 0; ItemDataList itemDataList; @@ -1332,3 +1332,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { for (z = 0; z < nAttribs; z++) { - odebug << "HlManager::makeAttribs: createing one attribute definition" << oendl; + odebug << "HlManager::makeAttribs: creating an attribute definition" << oendl; itemData = itemDataList.at(z); @@ -1353,4 +1353,6 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) { a[z].selCol = black; - a[z].bold = defaultStyle->bold; - a[z].italic = defaultStyle->italic; + if (defaultStyle) { + a[z].bold = defaultStyle->bold; + a[z].italic = defaultStyle->italic; + } } diff --git a/noncore/net/ftplib/ftplib.c b/noncore/net/ftplib/ftplib.c index addf9d2..ce4c05f 100644 --- a/noncore/net/ftplib/ftplib.c +++ b/noncore/net/ftplib/ftplib.c @@ -783,3 +783,3 @@ static int FtpAcceptConnection(netbuf *nData, netbuf *nControl) fd_set mask; - int rv; + int rv = 1; diff --git a/noncore/settings/sysinfo/contrib/dhry.c b/noncore/settings/sysinfo/contrib/dhry.c index 07fd1c0..5426157 100644 --- a/noncore/settings/sysinfo/contrib/dhry.c +++ b/noncore/settings/sysinfo/contrib/dhry.c @@ -574,3 +574,3 @@ One_Fifty *Int_Par_Ref; One_Fifty Int_Loc; - Enumeration Enum_Loc; + Enumeration Enum_Loc = Ident_2; |