Typos in Abiword 2.1.0

From: Johnny Lee (typo_pl_at_hotmail.com)
Date: Tue Jan 20 2004 - 13:49:28 EST

  • Next message: Dom Lachowicz: "Re: Braille plug-in"

    Found with the typo.pl script from <http://www.cpan.org> against the Abiword
    2.1.0 source code.

    <ShamelessPlug>
    Info on typo.pl can be found at <http://www.geocities.com/typopl/> and
    <http://www.geocities.com/typopl/typo.htm>.
    </ShamelessPlug>

    The perl script doesn't know if code is live or not, I have examined the
    possible typos to make sure that they look like errors.

    Extraneous semicolon after if-statement Body of if-statement is always
    executed since
    if-statement applies only to first block/statement after if.
    =================================================
    abi\src\text\fmt\xp\fv_View_cmd.cpp (line 3408):
    if(pTab&&pTab==m_Selection.getTableLayout());

    Assignment in if statement. In the first case, since the var is set to zero,
    the body of the if-stmt will never be executed. Opposite is true for the
    second case, it's always run.
    Probably need an extra '='.
    ===============================================
    abi\src\wp\ap\beos\ap_BeOSFrame.cpp (line 877):
    if(iBarNb=0)

    abi\src\wp\ap\beos\ap_BeOSFrame.cpp (line 882):
    if(iBarNb=1)

    Assignments in ASSERT-type statements are usually bad.
    Probably need an extra '='.
    ========================================
    abi\src\af\util\beos\ut_Xpm2Bitmap.cpp (line 86):
    abi\src\af\util\qnx\ut_Xpm2Bitmap.cpp (line 113):
    abi\src\af\util\win\ut_Xpm2Bmp.cpp (line 123):
    UT_ASSERT(bufKey[0]='c')

    abi\src\wp\ap\xp\ap_Dialog_Tab.cpp (line 564):
    abi\src\wp\ap\xp\ap_Dialog_Tab.cpp (line 640):
    UT_ASSERT(id=id_SPIN_DEFAULT_TAB_STOP)

    C-operator precedence rules - bitwise-AND is LOWER than ==
    Need to put parentheses around the bitwise-AND expression
    ========================================
    abi\src\af\xap\win\xap_Win32ColourButton.h (line 65):
    (dis->itemState&ODS_SELECTED==ODS_SELECTED)

    memset API is 'memset(ptr, value, size)'. Using zero for size is useless.
    parameters are probably swapped.
    =============================================
    abi\src\af\util\xp\ut_uuid.cpp (line 630):
    memset(&(this->m_uuid),sizeof(m_uuid),0)

    Boolean logic error.
    if you have " if (x != 5 || x != 6)"
    then if x == 5, the "x != 6 " expression will be true. Converse is the same.
    Probably wanted "if ((x != 5) && (x != 6))"
    =============================================
    abi\src\af\xap\win\xap_Win32Dlg_FileOpenSaveAs.cpp (line 663):
    if(iegft!=IEGFT_PNG||iegft!=IEGFT_SVG)

    abi\src\wp\ap\xp\ap_Menu_Functions.cpp (line 763):
    abi\src\wp\ap\xp\ap_Toolbar_Functions.cpp (line 369):
    if(pView->getDocument()->areStylesLocked()&&(AP_TOOLBAR_ID_FMT_SUPERSCRIPT!=id||AP_TOOLBAR_ID_FMT_SUBSCRIPT!=id))

    _________________________________________________________________
    Get a FREE online virus check for your PC here, from McAfee.
    http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



    This archive was generated by hypermail 2.1.4 : Tue Jan 20 2004 - 13:50:16 EST