Removed const from argv; removed comment header
This commit is contained in:
parent
f96e7e462e
commit
9dbb05d26c
@ -1,11 +1,3 @@
|
||||
//
|
||||
// main.cpp
|
||||
// sciotest
|
||||
//
|
||||
// Created by Bob Polis at 2020-02-14
|
||||
// Copyright (c) 2020 SwiftCoder. All rights reserved.
|
||||
//
|
||||
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@ -99,7 +91,7 @@ void test5() {
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
int main(int argc, char * argv[]) {
|
||||
try {
|
||||
struct option long_options[] = {
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
@ -109,7 +101,7 @@ int main(int argc, const char * argv[]) {
|
||||
};
|
||||
int opt_char, option_index;
|
||||
int test_id = 0;
|
||||
while ((opt_char = getopt_long(argc, const_cast<char* const *>(argv), "ht:v", long_options, &option_index)) != -1) {
|
||||
while ((opt_char = getopt_long(argc, argv, "ht:v", long_options, &option_index)) != -1) {
|
||||
switch (opt_char) {
|
||||
case 0: {
|
||||
// handle long-only options here
|
||||
|
Loading…
x
Reference in New Issue
Block a user