move const data to readonly segment

This commit is contained in:
Andrei Kurushin 2017-01-09 15:38:46 +03:00 committed by Arvid Norberg
parent d1ea80c2c3
commit 5fa48c65da
3 changed files with 8 additions and 8 deletions

View File

@ -349,7 +349,7 @@ static unsigned char negative(signed char b) {
return (unsigned char) x; 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->yplusx, u->yplusx, b);
fe_cmov(t->yminusx, u->yminusx, b); fe_cmov(t->yminusx, u->yminusx, b);
fe_cmov(t->xy2d, u->xy2d, b); fe_cmov(t->xy2d, u->xy2d, b);

View File

@ -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 }, { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 },
{ -12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378 }, { -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 */ /* 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 }, { 25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605 },

View File

@ -137,7 +137,7 @@ namespace
// only support BitTorrentSpecification // only support BitTorrentSpecification
// must be ordered alphabetically // must be ordered alphabetically
static map_entry name_map[] = static const map_entry name_map[] =
{ {
{"7T", "aTorrent for android"} {"7T", "aTorrent for android"}
, {"A", "ABC"} , {"A", "ABC"}
@ -238,12 +238,12 @@ namespace
struct generic_map_entry struct generic_map_entry
{ {
int const offset; int offset;
char const* id; char const* id;
char const* name; char const* name;
}; };
// non-standard names // non-standard names
static generic_map_entry generic_mappings[] = static const generic_map_entry generic_mappings[] =
{ {
{0, "Deadman Walking-", "Deadman"} {0, "Deadman Walking-", "Deadman"}
, {5, "Azureus", "Azureus 2.0.3.2"} , {5, "Azureus", "Azureus 2.0.3.2"}
@ -294,8 +294,8 @@ namespace
char identity[200]; char identity[200];
const int size = sizeof(name_map)/sizeof(name_map[0]); const int size = sizeof(name_map)/sizeof(name_map[0]);
map_entry tmp = {f.name, ""}; const map_entry tmp = {f.name, ""};
map_entry* i = const map_entry* i =
std::lower_bound(name_map, name_map + size std::lower_bound(name_map, name_map + size
, tmp, &compare_id); , tmp, &compare_id);