Ken Takata wrote:

> Normally, char_u should be used for characters encoded in 'enc', and char
> should be used for characters encoded in the current code page.
> I found that some part of the code uses char_u and char wrongly.
> Attached patch fixes this.

Hmm, that's not really the rule.  The problem with "char" is that when
getting one character out of a string it may become negative.  What the
encoding is doesn't really matter.  To avoid that Vim mostly uses char_u
for text.  But all the C library functions work with "char", thus we end
up type casting here and there.

So, the rule is that we mostly use "char_u" to avoid the negative
character problem, and use "char" where needed, and then (more or less)
minimize the number of type casts.


-- 
What is the difference between a professional and an amateur?
The ark was built by an amateur; professionals gave us the Titanic.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui