Changeset 320fb45f0ccef622c2323e3ba0fa6b3ee5bb15f6
- Timestamp:
- 01/10/07 22:41:15
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1191271275 +0000
- git-parent:
[91994ef887870cbfe6ee081bb7495ee511460d6f]
- git-author:
- Rafaël Carré <funman@videolan.org> 1191271275 +0000
- Message:
ncurses: adds some (size_t) casting
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcc61952 |
r320fb45 |
|
| 1153 | 1153 | i_char_len = mbstowcs( psz_wide, p_buf, i_len ); |
|---|
| 1154 | 1154 | |
|---|
| 1155 | | if( i_char_len == -1 ) /* an invalid character was encountered */ |
|---|
| | 1155 | if( i_char_len == (size_t)-1 ) /* an invalid character was encountered */ |
|---|
| 1156 | 1156 | i_width = i_len; |
|---|
| 1157 | 1157 | else |
|---|
| 1158 | 1158 | { |
|---|
| 1159 | 1159 | i_width = wcswidth( psz_wide, i_char_len ); |
|---|
| 1160 | | if( i_width == -1 ) /* a non printable character was encountered */ |
|---|
| | 1160 | if( i_width == (size_t)-1 ) /* a non printable character was encountered */ |
|---|
| 1161 | 1161 | i_width = i_len; |
|---|
| 1162 | 1162 | } |
|---|
| 1163 | | if( i_width > w ) |
|---|
| | 1163 | if( i_width > (size_t)w ) |
|---|
| 1164 | 1164 | #else |
|---|
| 1165 | 1165 | if( i_len > w ) |
|---|
| 1166 | 1166 | #endif |
|---|
| 1167 | 1167 | { /* FIXME: ncursesw: ellipsize psz_wide while keeping the width in mind */ |
|---|
| 1168 | | char *psz_local; |
|---|
| 1169 | 1168 | int i_cut = i_len - w; |
|---|
| 1170 | 1169 | int x1 = i_len/2 - i_cut/2; |
|---|
| … | … | |
| 1185 | 1184 | mvprintw( y, x, "%s", p_buf ); |
|---|
| 1186 | 1185 | #else |
|---|
| 1187 | | psz_local = ToLocale( p_buf ); |
|---|
| | 1186 | char *psz_local = ToLocale( p_buf ); |
|---|
| 1188 | 1187 | mvprintw( y, x, "%s", psz_local ); |
|---|
| 1189 | 1188 | LocaleFree( p_buf ); |
|---|