From: tnishi Date: Fri, 25 Nov 2016 09:42:31 +0000 (+0900) Subject: BOOL→bool X-Git-Url: http://git.osdn.net/view?p=dokopop%2Fdokopop.git;a=commitdiff_plain;h=1729305fab568d2c0e23804fae4f609f7c3ae5f8 BOOL→bool --- diff --git a/DCHookTest/StringLib.cpp b/DCHookTest/StringLib.cpp index f630822..1531eff 100644 --- a/DCHookTest/StringLib.cpp +++ b/DCHookTest/StringLib.cpp @@ -15,11 +15,11 @@ // about : ‚¢‚¢‰ÁŒ¸‚È‚Æ‚±‚ë‚ðƒNƒŠƒbƒN‚µ‚Ä‚à’PŒê‚³‚¦‚ ‚ê‚ΕK‚¸get‚·‚é // alnum : ‰p”ŽšˆÈŠO‚Í–³Ž‹ -BOOL GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum ) +bool GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum ) { if ( !about ) if ( !IsWordChar( *(str+pos) ) ) - return FALSE; + return false; // while ( *(str+pos) == ' ' || *(str+pos) == '\t' ){ // pos++; // } @@ -61,7 +61,7 @@ rescan: wordtop = p; const tchar *wordtail = NULL; const tchar *wordprev = NULL; - BOOL fSpc = FALSE; + bool fSpc = false; // pos‚É‚ ‚é’PŒê‚Ìstart‚Æend‚ð‹‚ß‚é while ( *p ){ if ( !IsWordChar( *p ) || (alnum && !isalphanum(*p)) ){ @@ -79,7 +79,7 @@ rescan: } } } - fSpc = TRUE; + fSpc = true; } else { // ’PŒê•¶Žš if ( fSpc ){ @@ -99,7 +99,7 @@ rescan: if ( (unsigned)wordtop - (about ? 3 : 0) > (unsigned)(orgp + pos) ){ // ’PŒê‚Ì‹æØ‚肾‚Á‚½A’PŒê‚̍ŏ‰‚ªpos‚æ‚èŒã‚ë‚É‚ ‚Á‚½ // about = true‚̏ꍇ‚́A‚R•¶Žš•ª‚Ù‚Ç‚¢‚¢‚©‚°‚ñ·‚ð‘«‚µ‚Ä‚¨‚­ - return FALSE; + return false; } if ( fLongest ){ @@ -109,7 +109,7 @@ rescan: if ( !fSpc ){ if ( --wordcount == 0 ) break; - fSpc = TRUE; + fSpc = true; } } else { fSpc = FALSE; @@ -134,7 +134,7 @@ rescan: } else { prevstart = start; } - return TRUE; + return true; } #if 0 bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, int wordcount ) @@ -149,7 +149,7 @@ bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, const tchar *p = orgp; const tchar *wordtop = p; const tchar *wordtail = NULL; - BOOL fSpc = FALSE; + bool fSpc = false; while ( 1 ){ sp = p; LD_CHAR( c, p ); @@ -160,11 +160,11 @@ bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, wordtail = sp; break; } - fSpc = TRUE; + fSpc = true; } else { if ( fSpc ){ wordtop = sp; - fSpc = FALSE; + fSpc = false; } } } @@ -187,10 +187,10 @@ bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, if ( !fSpc ){ if ( --wordcount == 0 ) break; - fSpc = TRUE; + fSpc = true; } } else { - fSpc = FALSE; + fSpc = false; } } wordtail = sp; @@ -200,7 +200,7 @@ bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, wordtail = sp; start = STR_DIFF( wordtop, orgp ); end = STR_DIFF( wordtail, orgp ); - return TRUE; + return true; } bool mbIsWordChar( unsigned short c ) { diff --git a/DCHookTest/StringLib.h b/DCHookTest/StringLib.h index 4c3c371..79ceb92 100644 --- a/DCHookTest/StringLib.h +++ b/DCHookTest/StringLib.h @@ -43,7 +43,7 @@ typedef unsigned short ushort; // prototypes // int isalphanum( tuchar c ); bool mbIsWordChar( unsigned short c ); -BOOL GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum ); +bool GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum, int numPrev ); bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, int wordcount ); // inlines //