Menu

#22 suggest commenting out several functions

closed-accepted
nobody
1
2004-01-09
2002-12-08
No

Suggest commenting out or removing
the following unused functions in common/coretools.cpp

WriteWcsFromMbs (3 versions)
ReadWcsToMbs (3 versions)

They are not used, and contain copy & pasted
incorrect UNICODE code (what is wstrcpy ? a typo
for wcscpy ?)

I started to fix them, then wondered about the
1024 byte assumptions they make, then
realized that they nowhere called.

Discussion

  • Christian List

    Christian List - 2002-12-08

    Logged In: YES
    user_id=609728

    I have found a couple of functions more in coretools.cpp,
    which is not used anywhere:

    GetFileSizeEx
    GetFileTimes
    DoModalProcess
    GetLocalDrives is used by GetCDPath which is not used
    GetIP
    FPRINTF
    replace_char is used by ConvertPath2PS which is not used
    AddExtension
    is_all_whitespace
    GetFreeSpaceString
    is_regfile
    is_regfile2
    is_dirfile
    is_dirfile2
    fcmp
    aswap
    FindAnyFile
    SwapEndian (2 versions)
    RoundMeasure
    HaveAdminAccess
    LegalizeFileName
    DDX_Float
    DDX_Double
    GetLocalizedNumberString only used by DDX_Float and
    DDX_Double
    IsLocalPath

    Does anybody know why we keep these around ?

     
  • Kimmo Varis

    Kimmo Varis - 2003-03-17

    Logged In: YES
    user_id=631874

    Maybe that coretools.cpp is from some other project where
    those functions are used. I'd say just remove those.

     
  • Anonymous

    Anonymous - 2003-03-23

    Logged In: YES
    user_id=60964

    Hm. Most of this file we don't use. I think we only use

    FileExtMatches
    SplitFilename
    RunIt
    GetModulePath
    GetPathOnly

    How about moving them to paths.cpp, except for RunIt which
    goes to MainFrm.cpp (only place it is used), and then simply
    dropping coretools.cpp from the project ?

     
  • Anonymous

    Anonymous - 2003-07-03

    Logged In: YES
    user_id=60964

    Oh. I guess I don't understand your explanatory sentence
    "Includes files from Stdafx.h which are necessary".

    Those files don't come from Stdafx.h (which is a file in our
    project); they come from the Visual C++ MFC include directory.

     
  • Anonymous

    Anonymous - 2003-07-03

    Logged In: YES
    user_id=60964

    Darn -- previous comment doesn't belong here.

     
  • Anonymous

    Anonymous - 2003-07-03

    Logged In: YES
    user_id=60964

    Oops. I tried moving those functions into paths.cpp (along
    with a couple others I found were used). But this breaks
    MakeResDll, which uses some coretools functions. So, back to
    original idea -- just delete all the unused ones from
    coretools ?

    I'll do a patch file for deleting all the unused ones.

     
  • Anonymous

    Anonymous - 2003-07-03
    • status: open --> open-accepted
     
  • Anonymous

    Anonymous - 2003-07-03

    Logged In: YES
    user_id=60964

    These buggy & unused unicode functions (WriteWcsFromMbs,
    ReadWcsToMbs ) were already removed from coretools.cpp, by me,
    in the checkin of coretools

    version 1.8, 2003/02/22 22:39:04

    Therefore, I don't really care about this patch anymore. I
    suggest closing it at some point, if noone else demonstrates
    interest in deleting the various other unused files (as
    listed by Christian in the first comment below).

    In fact, that is why I have not closed this patch; although
    the patch text has been done, the issue of deleting all
    those other unused functions has never been addressed.
    Although I don't much care about them, I didn't know if I
    should delete the patch & lose that info.

     
  • Anonymous

    Anonymous - 2003-10-06
    • priority: 5 --> 1
     
  • Anonymous

    Anonymous - 2003-10-06

    Logged In: YES
    user_id=60964

    Lowering priority.

     
  • Christian List

    Christian List - 2004-01-09
    • labels: --> DIFF Engine
    • status: open-accepted --> closed-accepted
     
  • Christian List

    Christian List - 2004-01-09

    Logged In: YES
    user_id=609728

    I'll close this patch.
    It is not really important.

     

Log in to post a comment.