OSDN Git Service

Trivial type fixes, coding style fixes and converting comments to doxygen
authorKimmo Varis <kimmov@gmail.com>
Thu, 19 Oct 2006 21:05:41 +0000 (21:05 +0000)
committerKimmo Varis <kimmov@gmail.com>
Thu, 19 Oct 2006 21:05:41 +0000 (21:05 +0000)
Src/Changes.txt
Src/StdAfx.cpp
Src/StdAfx.h

index ec4c5ec..f6c9b53 100644 (file)
@@ -5,6 +5,8 @@ Add new items to top.
 2006-10-19 Kimmo
  PATCH: [ 1578419 ] Fix creating WinMerge folder to MyFolders always
   Src: MainFrm.cpp MainFrm.h
+ Trivial type fixes, coding style fixes and converting comments to doxygen
+  Src: StdAfx.cpp StdAfx.h
 
 2006-10-11 Kimmo
  PATCH: [ 1574696 ] Fix problem in saving filefilter to project file
index 3fef9f8..2360dbc 100644 (file)
@@ -43,7 +43,7 @@ UINT gLog::DeleteFileFailed(LPCTSTR path)
 // This is ok for the UNICODE build because UCS-2LE code bytes
 // do not extend as high as 2Gig (actually even full Unicode
 // codepoints don't extend that high).
-int normch(int c)
+static wint_t normch(wint_t c)
 {
 #ifdef _UNICODE
        return (unsigned short)(short)c;
@@ -52,38 +52,44 @@ int normch(int c)
 #endif
 }
 
-// Returns nonzero if input is outside ASCII or is underline
-int
-xisspecial (int c)
+/** @brief Return nonzero if input is outside ASCII or is underline. */
+int xisspecial (wint_t c)
 {
   return normch(c) > (unsigned) _T ('\x7f') || c == _T ('_');
 }
 
-// Returns non-zero if input is alphabetic or "special" (see xisspecial)
-// Also converts any negative inputs to negative char equivalents (see normch)
-int
-xisalpha (int c)
+/**
+ * @brief Return non-zero if input is alphabetic or "special" (see xisspecial).
+ * Also converts any negative inputs to negative char equivalents (see normch).
+ */
+int xisalpha (wint_t c)
 {
   return _istalpha (normch(c)) || xisspecial (normch(c));
 }
 
-// Returns non-zero if input is alphanumeric or "special" (see xisspecial)
-// Also converts any negative inputs to negative char equivalents (see normch)
-int
-xisalnum (int c)
+/**
+ * @brief Return non-zero if input is alphanumeric or "special" (see xisspecial).
+ * Also converts any negative inputs to negative char equivalents (see normch).
+ */
+int xisalnum (wint_t c)
 {
   return _istalnum (normch(c)) || xisspecial (normch(c));
 }
 
-// Returns non-zero if input character is a space
-// Also converts any negative inputs to negative char equivalents (see normch)
-int
-xisspace (int c)
+/**
+ * @brief Return non-zero if input character is a space.
+ * Also converts any negative inputs to negative char equivalents (see normch).
+ */
+int xisspace (wint_t c)
 {
   return _istspace (normch(c));
 }
 
-// Load string resource and return as CString
+/**
+ * @brief Load string resource and return as CString.
+ * @param [in] id Resource string ID.
+ * @return Resource string as CString.
+ */
 CString LoadResString(int id)
 {
        CString s;
@@ -91,13 +97,20 @@ CString LoadResString(int id)
        return s;
 }
 
-// Combines AfxFormatString1 with AfxMessageBox
-int
-ResMsgBox1(int msgid, LPCTSTR arg, UINT nType, UINT nIDHelp)
+/**
+ * @brief Show messagebox with resource string having parameter.
+ * @param [in] msgid Resource string ID.
+ * @param [in] arg Argument string.
+ * @param [in] nType Messagebox type flags (e.g. MB_OK).
+ * @param [in] nIDHelp Help string ID.
+ * @return User choice from the messagebox (see MessageBox()).
+ */
+int ResMsgBox1(int msgid, LPCTSTR arg, UINT nType, UINT nIDHelp)
 {
        CString msg;
        AfxFormatString1(msg, msgid, arg);
-       if (!nIDHelp) nIDHelp = msgid;
+       if (!nIDHelp)
+               nIDHelp = msgid;
        return AfxMessageBox(msg, nType, nIDHelp);
 }
 
index 35cfe92..eae6743 100644 (file)
@@ -70,10 +70,10 @@ static const UINT SmallTimeDiff = 2;
 
 // Miscellaneous functions defined in StdAfx.cpp
 
-int xisspecial (int c);
-int xisalpha (int c);
-int xisalnum (int c);
-int xisspace (int c);
+int xisspecial (wint_t c);
+int xisalpha (wint_t c);
+int xisalnum (wint_t c);
+int xisspace (wint_t c);
 
        /** @brief Load string from string resources; shortcut for CString::LoadString */
 CString LoadResString(int id);