deci and move are part of a C++11 STL implementation. Explicitly include

the namespace when using the former and rename the latter.
This commit is contained in:
joerg 2013-06-26 15:49:31 +00:00
parent 68fa79bac1
commit dc7e576a6a
16 changed files with 474 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.26 2012/11/23 19:08:19 marino Exp $ $NetBSD: distinfo,v 1.27 2013/06/26 15:49:31 joerg Exp $
SHA1 (dar-2.4.1.tar.gz) = 1fac505e2b6e2b05acd96c42e9bfb135974e9807 SHA1 (dar-2.4.1.tar.gz) = 1fac505e2b6e2b05acd96c42e9bfb135974e9807
RMD160 (dar-2.4.1.tar.gz) = d835bd82f9f4f91defb2301084af4c0343e37faf RMD160 (dar-2.4.1.tar.gz) = d835bd82f9f4f91defb2301084af4c0343e37faf
@ -11,4 +11,19 @@ SHA1 (patch-ae) = 54220384bf2031df64c38f5abea038382ca37e8e
SHA1 (patch-af) = 0fc93ae2638d77b247e6339f3a5819e5eeb059f0 SHA1 (patch-af) = 0fc93ae2638d77b247e6339f3a5819e5eeb059f0
SHA1 (patch-ag) = 3873d5dd9e387c90977b169e4532891bcf242e49 SHA1 (patch-ag) = 3873d5dd9e387c90977b169e4532891bcf242e49
SHA1 (patch-src_check_all__features.cpp) = 2d962e4c17d93242b281b72bec8ed5cec8aa0e49 SHA1 (patch-src_check_all__features.cpp) = 2d962e4c17d93242b281b72bec8ed5cec8aa0e49
SHA1 (patch-src_dar__suite_command__line.cpp) = 63d3004bf7d49277c1508fe5d9ac52ec0d5bf11f
SHA1 (patch-src_dar__suite_crit__action__cmd__line.cpp) = bc9484e836fbde98f682f6031aaadd99cc8eb479
SHA1 (patch-src_dar__suite_dar__manager.cpp) = 2ed9008b5e7629ef8e279b7d1218a4fae5101df1
SHA1 (patch-src_dar__suite_dar__xform.cpp) = 929e7cbb933a8d58bd1b79ecb50404f5dbbfddfe
SHA1 (patch-src_dar__suite_line__tools.cpp) = 076c5213aaa3e6dfa471322b6597c0ce8ccfd2a8
SHA1 (patch-src_examples_factoriel.cpp) = 6c9e038b7a3bbfdc96dbbdf1b7e100c159353f87
SHA1 (patch-src_examples_formula.cpp) = 583ceeba0a232e657ab0696711f630476ec2e495
SHA1 (patch-src_examples_prime.cpp) = 09fc3b96642945042a2d13bb4c1995546cdb7607
SHA1 (patch-src_libdar_mask__list.hpp) = b16686706cb7ad7065467decfd93271f01d9c663
SHA1 (patch-src_libdar_secu__string.hpp) = 021d3b5a126b66b2afc28d24b952eeb47b6ffe81 SHA1 (patch-src_libdar_secu__string.hpp) = 021d3b5a126b66b2afc28d24b952eeb47b6ffe81
SHA1 (patch-src_testing_test__catalogue.cpp) = 2d1a8299f01776e3fa9996819aa8be523b73b4cc
SHA1 (patch-src_testing_test__deci.cpp) = 053e2123a5219dc0cb827743e348f9463ce84615
SHA1 (patch-src_testing_test__escape.cpp) = b7959b2e5e3675d2e64f232face3b18384f8e3da
SHA1 (patch-src_testing_test__infinint.cpp) = 5ee29a1881b05881bb334f1cd7bfd30ea21baf7f
SHA1 (patch-src_testing_test__terminateur.cpp) = 79d4efadfc4528d6def28985228a0d25d1fc6e78
SHA1 (patch-src_testing_testtools.cpp) = 4cdd4a6fde69f40463464f6ead1d208a685a516b

View file

@ -0,0 +1,31 @@
$NetBSD: patch-src_dar__suite_command__line.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/dar_suite/command_line.cpp.orig 2013-06-20 19:13:40.000000000 +0000
+++ src/dar_suite/command_line.cpp
@@ -758,7 +758,7 @@ static bool get_args_recursive(recursive
try
{
// trying to read a simple integer
- deci tmp = string(optarg);
+ libdar::deci tmp = string(optarg);
p.fixed_date = tmp.computer();
}
catch(Edeci & e)
@@ -845,7 +845,7 @@ static bool get_args_recursive(recursive
case 'p':
if(optarg != NULL)
{
- deci conv = string(optarg);
+ libdar::deci conv = string(optarg);
p.pause = conv.computer();
}
else
@@ -1222,7 +1222,7 @@ static bool get_args_recursive(recursive
{
try
{
- p.hourshift = deci(string(optarg)).computer();
+ p.hourshift = libdar::deci(string(optarg)).computer();
}
catch(Edeci & e)
{

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_dar__suite_crit__action__cmd__line.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/dar_suite/crit_action_cmd_line.cpp.orig 2013-06-20 19:17:02.000000000 +0000
+++ src/dar_suite/crit_action_cmd_line.cpp
@@ -413,7 +413,7 @@ static const criterium * criterium_creat
case 'r':
try
{
- deci tmp = sub_arg;
+ libdar::deci tmp = sub_arg;
date = tmp.computer();
}
catch(Edeci & e)

View file

@ -0,0 +1,76 @@
$NetBSD: patch-src_dar__suite_dar__manager.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/dar_suite/dar_manager.cpp.orig 2013-06-20 19:21:17.000000000 +0000
+++ src/dar_suite/dar_manager.cpp
@@ -78,7 +78,7 @@ using namespace libdar;
#define MISSING_ARG "Missing argument to -%c"
#define INVALID_ARG "Invalid argument given to -%c (requires integer)"
-enum operation { none_op, create, add, listing, del, chbase, where, options, dar, restore, used, files, stats, move, interactive, check, batch };
+enum operation { none_op, create, add, listing, del, chbase, where, options, dar, restore, used, files, stats, my_move, interactive, check, batch };
static S_I little_main(user_interaction & dialog, S_I argc, char *const argv[], const char **env);
static bool command_line(user_interaction & dialog,
@@ -183,7 +183,7 @@ S_I little_main(user_interaction & dialo
case used:
case files:
case stats:
- case move:
+ case my_move:
case interactive:
case check:
case batch:
@@ -386,7 +386,7 @@ static bool command_line(user_interactio
case 'm':
if(op != none_op)
throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu)));
- op = move;
+ op = my_move;
if(optarg == NULL)
throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu)));
num = tools_str2int(optarg);
@@ -448,7 +448,7 @@ static bool command_line(user_interactio
{
try
{
- deci tmp = string(optarg);
+ libdar::deci tmp = string(optarg);
date = tmp.computer();
}
catch(Edeci & e)
@@ -529,7 +529,7 @@ static bool command_line(user_interactio
break;
case options:
break;
- case move:
+ case my_move:
if(rest.size() != 1)
{
dialog.warning(gettext("Missing argument to command line, aborting"));
@@ -1068,7 +1068,7 @@ static void op_interactive(user_interact
saved = false;
break;
case 'm':
- input = dialog.get_string(gettext("Archive number to move: "), true);
+ input = dialog.get_string(gettext("Archive number to my_move: "), true);
num = tools_str2int(input);
input = dialog.get_string(gettext("In which position to insert this archive: "), true);
num2 = tools_str2int(input);
@@ -1298,7 +1298,7 @@ static void finalize(user_interaction &
case where:
case options:
case dar:
- case move:
+ case my_move:
case batch:
if(info_details)
dialog.warning(gettext("Compressing and writing back database to file..."));
@@ -1362,7 +1362,7 @@ static void action(user_interaction & di
case stats:
op_stats(dialog, dat, info_details);
break;
- case move:
+ case my_move:
op_move(dialog, dat, num, num2, info_details);
break;
case interactive:

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_dar__suite_dar__xform.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/dar_suite/dar_xform.cpp.orig 2013-06-20 19:18:01.000000000 +0000
+++ src/dar_suite/dar_xform.cpp
@@ -314,7 +314,7 @@ static bool command_line(user_interactio
case 'p':
if(optarg != NULL)
{
- deci conv = string(optarg);
+ libdar::deci conv = string(optarg);
pause = conv.computer();
}
else

View file

@ -0,0 +1,56 @@
$NetBSD: patch-src_dar__suite_line__tools.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/dar_suite/line_tools.cpp.orig 2013-06-20 19:14:58.000000000 +0000
+++ src/dar_suite/line_tools.cpp
@@ -215,8 +215,8 @@ void line_tools_repeat_param(const strin
try
{
- deci x1 = tmp1;
- deci x2 = tmp2;
+ libdar::deci x1 = tmp1;
+ libdar::deci x2 = tmp2;
repeat_count = x1.computer();
repeat_byte = x2.computer();
@@ -514,14 +514,14 @@ void line_tools_get_min_digits(string th
it1 = tools_find_first_char_of(the_arg, ',');
if(it1 == the_arg.end()) // a single number is provided
{
- deci tmp = the_arg;
+ libdar::deci tmp = the_arg;
num = tmp.computer();
}
else // at least two numbers are provided
{
if(the_arg.begin() != it1)
{
- deci convert = string(the_arg.begin(), it1);
+ libdar::deci convert = string(the_arg.begin(), it1);
num = convert.computer();
}
// else we ignore the leading ','
@@ -533,20 +533,20 @@ void line_tools_get_min_digits(string th
it2 = tools_find_first_char_of(tmp2, ',');
if(it2 == tmp2.end()) // just two number have been provided
{
- deci convert = tmp2;
+ libdar::deci convert = tmp2;
ref_num = convert.computer();
}
else
{
if(tmp2.begin() != it2)
{
- deci convert = string(tmp2.begin(), it2);
+ libdar::deci convert = string(tmp2.begin(), it2);
ref_num = convert.computer();
}
++it2;
if(it2 != tmp2.end())
{
- deci convert = string(it2, tmp2.end());
+ libdar::deci convert = string(it2, tmp2.end());
aux_num = convert.computer();
}
}

View file

@ -0,0 +1,31 @@
$NetBSD: patch-src_examples_factoriel.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/examples/factoriel.cpp.orig 2013-06-20 19:26:28.000000000 +0000
+++ src/examples/factoriel.cpp
@@ -85,7 +85,7 @@ static int little_main(user_interaction
exit(1);
string s = argv[1];
- deci f = s;
+ libdar::deci f = s;
infinint max = f.computer();
infinint i = 2;
infinint p = 1;
@@ -97,7 +97,7 @@ static int little_main(user_interaction
}
ui.warning("calcul finished, now computing the decimal representation ... ");
- f = deci(p);
+ f = libdar::deci(p);
ui.warning(f.human());
if(argc == 3)
{
@@ -112,7 +112,7 @@ static int little_main(user_interaction
p.dump(fic);
fic.skip(0);
cp = infinint(fic);
- ui.warning(string("read from file: ") + deci(cp).human());
+ ui.warning(string("read from file: ") + libdar::deci(cp).human());
}
}

View file

@ -0,0 +1,22 @@
$NetBSD: patch-src_examples_formula.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/examples/formula.cpp.orig 2013-06-20 19:27:22.000000000 +0000
+++ src/examples/formula.cpp
@@ -60,7 +60,7 @@ int little_main(user_interaction & ui, S
else
{
string formula = crit_action_canonize_string(argv[1]);
- deci tmp = calculus(formula);
+ libdar::deci tmp = calculus(formula);
cout << tmp.human() << endl;
@@ -113,7 +113,7 @@ static infinint calculus(const string &
return calculus(string(formula.begin() + 1, formula.end() - 1));
else // assuming an integer
{
- deci tmp = formula;
+ libdar::deci tmp = formula;
return tmp.computer();
}
}

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_examples_prime.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/examples/prime.cpp.orig 2013-06-20 19:27:04.000000000 +0000
+++ src/examples/prime.cpp
@@ -58,7 +58,7 @@ int little_main(user_interaction & ui, S
exit(1);
}
- deci x = string(argv[1]);
+ libdar::deci x = string(argv[1]);
cout << "converting string to infinint... " << endl;
infinint num = x.computer();
cout << "checking whether the number is a prime factor... " << endl;

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_libdar_mask__list.hpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/libdar/mask_list.hpp.orig 2013-06-20 19:11:02.000000000 +0000
+++ src/libdar/mask_list.hpp
@@ -80,7 +80,7 @@ namespace libdar
class my_char
{
public:
- my_char() { val = 0; };
+ my_char() = default;
my_char(const char x) : val(x) {};
bool operator < (const my_char & x) const
{

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_testing_test__catalogue.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/test_catalogue.cpp.orig 2013-06-20 19:28:21.000000000 +0000
+++ src/testing/test_catalogue.cpp
@@ -258,7 +258,7 @@ void f2()
if(i->is_more_recent_than(*w, 0))
{
cout << "plus recent" << endl;
- cout << "new is " << deci(w->get_last_modif()).human() << " ref " << deci(i->get_last_modif()).human() << endl;
+ cout << "new is " << libdar::deci(w->get_last_modif()).human() << " ref " << libdar::deci(i->get_last_modif()).human() << endl;
}
else
cout << "pas plus recent" << endl;

View file

@ -0,0 +1,18 @@
$NetBSD: patch-src_testing_test__deci.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/test_deci.cpp.orig 2013-06-20 19:29:44.000000000 +0000
+++ src/testing/test_deci.cpp
@@ -39,10 +39,10 @@ int main()
static void f1()
{
- deci d1 = string("00001");
+ libdar::deci d1 = string("00001");
infinint t = 3;
- deci d2 = t;
- deci d3 = infinint(125);
+ libdar::deci d2 = t;
+ libdar::deci d3 = infinint(125);
U_I c;
cout << d1.human() << endl;

View file

@ -0,0 +1,11 @@
$NetBSD: patch-src_testing_test__escape.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/test_escape.cpp.orig 2013-06-20 19:30:16.000000000 +0000
+++ src/testing/test_escape.cpp
@@ -121,5 +121,5 @@ void f2()
cout << "OK" << endl;
else
cout << "NOK" << endl;
- cout << deci(tested.get_position()).human() << endl;
+ cout << libdar::deci(tested.get_position()).human() << endl;
}

View file

@ -0,0 +1,122 @@
$NetBSD: patch-src_testing_test__infinint.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/test_infinint.cpp.orig 2013-06-20 19:28:49.000000000 +0000
+++ src/testing/test_infinint.cpp
@@ -83,9 +83,9 @@ static void routine1()
infinint f2 = f1;
infinint f3 = 0;
- deci d1 = f1;
- deci d2 = f2;
- deci d3 = f3;
+ libdar::deci d1 = f1;
+ libdar::deci d2 = f2;
+ libdar::deci d3 = f3;
ui->warning(d1.human() + " " + d2.human() + " " + d3.human());
@@ -98,7 +98,7 @@ static void routine1()
if(fd >= 0)
{
f3 = infinint(*ui, fd);
- d3 = deci(f3);
+ d3 = libdar::deci(f3);
ui->warning(d3.human());
}
close(fd);
@@ -106,33 +106,33 @@ static void routine1()
}
f1 += 3;
- d1 = deci(f1);
+ d1 = libdar::deci(f1);
ui->warning(d1.human());
f1 -= 2;
- d1 = deci(f1);
+ d1 = libdar::deci(f1);
ui->warning(d1.human());
f1 *= 10;
- d1 = deci(f1);
+ d1 = libdar::deci(f1);
ui->warning(d1.human());
f2 = f1;
f1 /= 3;
- d1 = deci(f1);
+ d1 = libdar::deci(f1);
ui->warning(d1.human());
f2 %= 3;
- d2 = deci(f2);
+ d2 = libdar::deci(f2);
ui->warning(d2.human());
f2 >>= 12;
- d2 = deci(f2);
+ d2 = libdar::deci(f2);
ui->warning(d2.human());
f1 = 4;
f2 >>= f1;
- d2 = deci(f2);
+ d2 = libdar::deci(f2);
ui->warning(d2.human());
f1 = 4+12;
@@ -143,9 +143,9 @@ static void routine1()
cout << f3 << endl;
cout << (123 << 16) << endl;
f2 <<= 4+12;
- d2 = deci(f2);
+ d2 = libdar::deci(f2);
ui->warning(d2.human());
- d3 = deci(f3);
+ d3 = libdar::deci(f3);
ui->warning(d3.human());
try
@@ -184,12 +184,12 @@ static void routine1()
{
for(f3 = 2; f3 <= f1; f3++)
{
- d1 = deci(f1);
- d2 = deci(f2);
- d3 = deci(f3);
+ d1 = libdar::deci(f1);
+ d2 = libdar::deci(f2);
+ d3 = libdar::deci(f3);
ui->warning(d1.human() + " " + d2.human() + " " + d3.human());
f2 *= f3;
- d2 = deci(f2);
+ d2 = libdar::deci(f2);
ui->warning(d2.human());
}
}
@@ -197,17 +197,17 @@ static void routine1()
{
ui->warning(e.get_message());
}
- d2 = deci(f2);
- d1 = deci(f1);
+ d2 = libdar::deci(f2);
+ d1 = libdar::deci(f1);
ui->warning(string("factoriel(") + d1.human() + ") = " + d2.human());
}
static void routine2()
{
- ui->warning(deci(infinint(2).power((U_I)0)).human());
- ui->warning(deci(infinint(2).power(infinint(0))).human());
- ui->warning(deci(infinint(2).power((U_I)1)).human());
- ui->warning(deci(infinint(2).power(infinint(1))).human());
- ui->warning(deci(infinint(2).power((U_I)2)).human());
- ui->warning(deci(infinint(2).power(infinint(2))).human());
+ ui->warning(libdar::deci(infinint(2).power((U_I)0)).human());
+ ui->warning(libdar::deci(infinint(2).power(infinint(0))).human());
+ ui->warning(libdar::deci(infinint(2).power((U_I)1)).human());
+ ui->warning(libdar::deci(infinint(2).power(infinint(1))).human());
+ ui->warning(libdar::deci(infinint(2).power((U_I)2)).human());
+ ui->warning(libdar::deci(infinint(2).power(infinint(2))).human());
}

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_testing_test__terminateur.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/test_terminateur.cpp.orig 2013-06-20 19:28:01.000000000 +0000
+++ src/testing/test_terminateur.cpp
@@ -83,7 +83,7 @@ static void f1()
for(S_I i=2;i<30;i++)
grand *= i;
- deci conv = grand;
+ libdar::deci conv = grand;
cout << conv.human() << endl;
term.set_catalogue_start(grand);
term.dump(toto);

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_testing_testtools.cpp,v 1.1 2013/06/26 15:49:31 joerg Exp $
--- src/testing/testtools.cpp.orig 2013-06-20 19:29:24.000000000 +0000
+++ src/testing/testtools.cpp
@@ -35,7 +35,7 @@ using namespace std;
void display(const infinint & x)
{
- deci vu = x;
+ libdar::deci vu = x;
cout << vu.human() << endl;
}