diff --git a/ed25519/src/ge.cpp b/ed25519/src/ge.cpp index 8bcb12fdc..704877b24 100644 --- a/ed25519/src/ge.cpp +++ b/ed25519/src/ge.cpp @@ -349,7 +349,7 @@ static unsigned char negative(signed char b) { return (unsigned char) x; } -static void cmov(ge_precomp *t, ge_precomp *u, unsigned char b) { +static void cmov(ge_precomp *t, const ge_precomp *u, unsigned char b) { fe_cmov(t->yplusx, u->yplusx, b); fe_cmov(t->yminusx, u->yminusx, b); fe_cmov(t->xy2d, u->xy2d, b); diff --git a/ed25519/src/precomp_data.h b/ed25519/src/precomp_data.h index ea00e4cc6..791454f89 100644 --- a/ed25519/src/precomp_data.h +++ b/ed25519/src/precomp_data.h @@ -1,4 +1,4 @@ -static ge_precomp Bi[8] = { +static const ge_precomp Bi[8] = { { { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 }, { -12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378 }, @@ -43,7 +43,7 @@ static ge_precomp Bi[8] = { /* base[i][j] = (j+1)*256^i*B */ -static ge_precomp base[32][8] = { +static const ge_precomp base[32][8] = { { { { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 }, diff --git a/src/identify_client.cpp b/src/identify_client.cpp index 5b4a104ef..37e13fab6 100644 --- a/src/identify_client.cpp +++ b/src/identify_client.cpp @@ -137,7 +137,7 @@ namespace // only support BitTorrentSpecification // must be ordered alphabetically - static map_entry name_map[] = + static const map_entry name_map[] = { {"7T", "aTorrent for android"} , {"A", "ABC"} @@ -238,12 +238,12 @@ namespace struct generic_map_entry { - int const offset; + int offset; char const* id; char const* name; }; // non-standard names - static generic_map_entry generic_mappings[] = + static const generic_map_entry generic_mappings[] = { {0, "Deadman Walking-", "Deadman"} , {5, "Azureus", "Azureus 2.0.3.2"} @@ -294,8 +294,8 @@ namespace char identity[200]; const int size = sizeof(name_map)/sizeof(name_map[0]); - map_entry tmp = {f.name, ""}; - map_entry* i = + const map_entry tmp = {f.name, ""}; + const map_entry* i = std::lower_bound(name_map, name_map + size , tmp, &compare_id);