mirror of
https://github.com/lammertb/libhttp.git
synced 2025-09-04 12:42:09 +03:00
Correct casting of pointers
Casting pointers to intgers for arithmetic should be done with intptr_t as that is corrected for pointer widths on 32bit and 64bit systems
This commit is contained in:
10
src/main.c
10
src/main.c
@@ -1299,7 +1299,7 @@ static int get_password(const char *user,
|
|||||||
12,
|
12,
|
||||||
"Cancel");
|
"Cancel");
|
||||||
|
|
||||||
assert((int)p - (int)mem < (int)sizeof(mem));
|
assert((intptr_t)p - (intptr_t)mem < (intptr_t)sizeof(mem));
|
||||||
|
|
||||||
dia->cy = y + (WORD)(HEIGHT * 1.5);
|
dia->cy = y + (WORD)(HEIGHT * 1.5);
|
||||||
|
|
||||||
@@ -1519,7 +1519,7 @@ static void show_settings_dialog()
|
|||||||
"");
|
"");
|
||||||
nelems++;
|
nelems++;
|
||||||
|
|
||||||
assert(((int)p - (int)mem) < (int)sizeof(mem));
|
assert(((intptr_t)p - (intptr_t)mem) < (intptr_t)sizeof(mem));
|
||||||
}
|
}
|
||||||
|
|
||||||
y = (WORD)(((nelems + 1) / 2 + 1) * HEIGHT + 5);
|
y = (WORD)(((nelems + 1) / 2 + 1) * HEIGHT + 5);
|
||||||
@@ -1585,7 +1585,7 @@ static void show_settings_dialog()
|
|||||||
12,
|
12,
|
||||||
g_server_base_name);
|
g_server_base_name);
|
||||||
|
|
||||||
assert(((int)p - (int)mem) < (int)sizeof(mem));
|
assert(((intptr_t)p - (intptr_t)mem) < (intptr_t)sizeof(mem));
|
||||||
|
|
||||||
dia->cy = ((nelems + 1) / 2 + 1) * HEIGHT + 30;
|
dia->cy = ((nelems + 1) / 2 + 1) * HEIGHT + 30;
|
||||||
DialogBoxIndirectParam(NULL, dia, NULL, SettingsDlgProc, (LPARAM)NULL);
|
DialogBoxIndirectParam(NULL, dia, NULL, SettingsDlgProc, (LPARAM)NULL);
|
||||||
@@ -1724,7 +1724,7 @@ static void change_password_file()
|
|||||||
u);
|
u);
|
||||||
|
|
||||||
nelems++;
|
nelems++;
|
||||||
assert(((int)p - (int)mem) < (int)sizeof(mem));
|
assert(((intptr_t)p - (intptr_t)mem) < (intptr_t)sizeof(mem));
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
@@ -1786,7 +1786,7 @@ static void change_password_file()
|
|||||||
12,
|
12,
|
||||||
g_server_base_name);
|
g_server_base_name);
|
||||||
|
|
||||||
assert(((int)p - (int)mem) < (int)sizeof(mem));
|
assert(((intptr_t)p - (intptr_t)mem) < (intptr_t)sizeof(mem));
|
||||||
|
|
||||||
dia->cy = y + 20;
|
dia->cy = y + 20;
|
||||||
} while ((IDOK == DialogBoxIndirectParam(
|
} while ((IDOK == DialogBoxIndirectParam(
|
||||||
|
Reference in New Issue
Block a user