Changeset 15 in flair-src for trunk/tools/FlairGCS/src/main.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (5 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/main.cpp

    r10 r15  
    1818int port;
    1919
    20 void parseOptions(int argc, char** argv) {
    21         try {
    22         CmdLine cmd("Command description message", ' ', "0.1");
     20void parseOptions(int argc, char **argv) {
     21  try {
     22    CmdLine cmd("Command description message", ' ', "0.1");
    2323
    24         ValueArg<string> nameArg("n","name","uav name",false,"x4-0","string");
    25         cmd.add( nameArg );
     24    ValueArg<string> nameArg("n", "name", "uav name", false, "x4-0", "string");
     25    cmd.add(nameArg);
    2626
    27         ValueArg<int> portArg("p","port","port number",false,9000,"int");
    28         cmd.add( portArg );
     27    ValueArg<int> portArg("p", "port", "port number", false, 9000, "int");
     28    cmd.add(portArg);
    2929
    30         cmd.parse( argc, argv );
     30    cmd.parse(argc, argv);
    3131
    32         // Get the value parsed by each arg.
    33         name= nameArg.getValue();
    34         port = portArg.getValue();
     32    // Get the value parsed by each arg.
     33    name = nameArg.getValue();
     34    port = portArg.getValue();
    3535
    36         } catch (ArgException &e) {// catch any exceptions
    37         cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
    38     }
     36  } catch (ArgException &e) { // catch any exceptions
     37    cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
     38  }
    3939}
    4040
    4141int main(int argc, char *argv[]) {
    4242
    43     union {
    44         uint32_t i;
    45         char c[4];
    46     } bint = {0x01020304};
     43  union {
     44    uint32_t i;
     45    char c[4];
     46  } bint = {0x01020304};
    4747
    48     if(bint.c[0] == 1) {
    49         printf("error, ground station is only compatible with little endian\n");
    50         return -1;
    51     }
     48  if (bint.c[0] == 1) {
     49    printf("error, ground station is only compatible with little endian\n");
     50    return -1;
     51  }
    5252
    53     printf(SVN_REV);
     53  printf(SVN_REV);
    5454
    55     parseOptions(argc,argv);
    56     printf("listening on port %i\n",port);
     55  parseOptions(argc, argv);
     56  printf("listening on port %i\n", port);
    5757
    58     qRegisterMetaType<const char*>("const char*");
    59     QLocale::setDefault(QLocale::C);
    60     QApplication app(argc, argv);
    61     app.setStyle(new QCleanlooksStyle);
     58  qRegisterMetaType<const char *>("const char*");
     59  QLocale::setDefault(QLocale::C);
     60  QApplication app(argc, argv);
     61  app.setStyle(new QCleanlooksStyle);
    6262
    63     Manager manager(QString::fromStdString(name),port);
     63  Manager manager(QString::fromStdString(name), port);
    6464
    65     manager.show();
     65  manager.show();
    6666
    67     app.exec();
     67  app.exec();
    6868}
Note: See TracChangeset for help on using the changeset viewer.