summaryrefslogtreecommitdiff
path: root/win32/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-24 10:18:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-24 10:18:35 +0000
commitfa13cb050db8091658007df77f8247ae02442e51 (patch)
tree23315eb20ba363466de132873e8ba3ba24d93ee5 /win32/file.c
parent5d77730f69889d7357dc7235728c2d4db3721c80 (diff)
win32: suppress warnings
* win32/file.c (home_dir, code_page_i): parenthesize to suppress warnings. * win32/win32.c (is_command_com, join_argv, w32_cmdvector, kill), (constat_attr_color_reverse, constat_attr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/file.c')
-rw-r--r--win32/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/win32/file.c b/win32/file.c
index fc10ca0068e..a50d6d8638e 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -63,13 +63,13 @@ home_dir(void)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683188(v=vs.85).aspx
*/
- if (len = GetEnvironmentVariableW(L"HOME", NULL, 0)) {
+ if ((len = GetEnvironmentVariableW(L"HOME", NULL, 0)) != 0) {
buffer_len = len;
home_env = 1;
}
- else if (len = GetEnvironmentVariableW(L"HOMEDRIVE", NULL, 0)) {
+ else if ((len = GetEnvironmentVariableW(L"HOMEDRIVE", NULL, 0)) != 0) {
buffer_len = len;
- if (len = GetEnvironmentVariableW(L"HOMEPATH", NULL, 0)) {
+ if ((len = GetEnvironmentVariableW(L"HOMEPATH", NULL, 0)) != 0) {
buffer_len += len;
home_env = 2;
}
@@ -77,7 +77,7 @@ home_dir(void)
buffer_len = 0;
}
}
- else if (len = GetEnvironmentVariableW(L"USERPROFILE", NULL, 0)) {
+ else if ((len = GetEnvironmentVariableW(L"USERPROFILE", NULL, 0)) != 0) {
buffer_len = len;
home_env = 3;
}
@@ -160,7 +160,7 @@ code_page_i(st_data_t name, st_data_t idx, st_data_t arg)
USHORT *table = cp->table;
if (count <= idx) {
unsigned int i = count;
- cp->count = count = ((idx + 4) & ~31 | 28);
+ cp->count = count = (((idx + 4) & ~31) | 28);
cp->table = table = realloc(table, count * sizeof(*table));
while (i < count) table[i++] = INVALID_CODE_PAGE;
}