diff options
author | Simon Warta <[email protected]> | 2015-12-08 19:56:19 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-08 22:02:28 +0100 |
commit | 368d087e3973db9d8c5b70443d31c27c03dfdbef (patch) | |
tree | 9059a52c70eee8b825d9fd7fa14194940853b86a /src/cmd/is_prime.cpp | |
parent | 53fca25da331d168b0433ba2e41b06aae9d17f5c (diff) |
Replace C interfaces in cli apps with C++ interfaces
Diffstat (limited to 'src/cmd/is_prime.cpp')
-rw-r--r-- | src/cmd/is_prime.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/is_prime.cpp b/src/cmd/is_prime.cpp index 703772477..71fec730b 100644 --- a/src/cmd/is_prime.cpp +++ b/src/cmd/is_prime.cpp @@ -12,20 +12,20 @@ namespace { -int is_prime(int argc, char* argv[]) +int is_prime(const std::vector<std::string> &args) { - if(argc != 2 && argc != 3) + if(args.size() != 2 && args.size() != 3) { - std::cerr << "Usage: " << argv[0] << " n <prob>" << std::endl; + std::cerr << "Usage: " << args[0] << " n <prob>" << std::endl; return 2; } - BigInt n(argv[1]); + BigInt n(args[1]); size_t prob = 56; - if(argc == 3) - prob = to_u32bit(argv[2]); + if(args.size() == 3) + prob = to_u32bit(args[2]); AutoSeeded_RNG rng; |