Changeset 18780 in vbox for trunk/src/VBox
- Timestamp:
- Apr 6, 2009 3:47:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r18591 r18780 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxManage - Implementation of -modifyvm command.3 * VBoxManage - Implementation of modifyvm command. 4 4 */ 5 5 … … 141 141 for (int i = 1; i < a->argc; i++) 142 142 { 143 if (strcmp(a->argv[i], "-name") == 0) 143 if ( !strcmp(a->argv[i], "--name") 144 || !strcmp(a->argv[i], "-name")) 144 145 { 145 146 if (a->argc <= i + 1) … … 148 149 name = a->argv[i]; 149 150 } 150 else if (strcmp(a->argv[i], "-ostype") == 0) 151 else if ( !strcmp(a->argv[i], "--ostype") 152 || !strcmp(a->argv[i], "-ostype")) 151 153 { 152 154 if (a->argc <= i + 1) … … 155 157 ostype = a->argv[i]; 156 158 } 157 else if (strcmp(a->argv[i], "-memory") == 0) 159 else if ( !strcmp(a->argv[i], "--memory") 160 || !strcmp(a->argv[i], "-memory")) 158 161 { 159 162 if (a->argc <= i + 1) … … 162 165 memorySize = RTStrToUInt32(a->argv[i]); 163 166 } 164 else if (strcmp(a->argv[i], "-vram") == 0) 167 else if ( !strcmp(a->argv[i], "--vram") 168 || !strcmp(a->argv[i], "-vram")) 165 169 { 166 170 if (a->argc <= i + 1) … … 169 173 vramSize = RTStrToUInt32(a->argv[i]); 170 174 } 171 else if (strcmp(a->argv[i], "-acpi") == 0) 175 else if ( !strcmp(a->argv[i], "--acpi") 176 || !strcmp(a->argv[i], "-acpi")) 172 177 { 173 178 if (a->argc <= i + 1) … … 176 181 acpi = a->argv[i]; 177 182 } 178 else if (strcmp(a->argv[i], "-ioapic") == 0) 183 else if ( !strcmp(a->argv[i], "--ioapic") 184 || !strcmp(a->argv[i], "-ioapic")) 179 185 { 180 186 if (a->argc <= i + 1) … … 183 189 ioapic = a->argv[i]; 184 190 } 185 else if (strcmp(a->argv[i], "-hwvirtex") == 0) 191 else if ( !strcmp(a->argv[i], "--hwvirtex") 192 || !strcmp(a->argv[i], "-hwvirtex")) 186 193 { 187 194 if (a->argc <= i + 1) … … 190 197 hwvirtex = a->argv[i]; 191 198 } 192 else if (strcmp(a->argv[i], "-nestedpaging") == 0) 199 else if ( !strcmp(a->argv[i], "--nestedpaging") 200 || !strcmp(a->argv[i], "-nestedpaging")) 193 201 { 194 202 if (a->argc <= i + 1) … … 197 205 nestedpaging = a->argv[i]; 198 206 } 199 else if (strcmp(a->argv[i], "-vtxvpid") == 0) 207 else if ( !strcmp(a->argv[i], "--vtxvpid") 208 || !strcmp(a->argv[i], "-vtxvpid")) 200 209 { 201 210 if (a->argc <= i + 1) … … 204 213 vtxvpid = a->argv[i]; 205 214 } 206 else if (strcmp(a->argv[i], "-pae") == 0) 215 else if ( !strcmp(a->argv[i], "--pae") 216 || !strcmp(a->argv[i], "-pae")) 207 217 { 208 218 if (a->argc <= i + 1) … … 211 221 pae = a->argv[i]; 212 222 } 213 else if (strcmp(a->argv[i], "-monitorcount") == 0) 223 else if ( !strcmp(a->argv[i], "--monitorcount") 224 || !strcmp(a->argv[i], "-monitorcount")) 214 225 { 215 226 if (a->argc <= i + 1) … … 218 229 monitorcount = RTStrToUInt32(a->argv[i]); 219 230 } 220 else if (strcmp(a->argv[i], "-accelerate3d") == 0) 231 else if ( !strcmp(a->argv[i], "--accelerate3d") 232 || !strcmp(a->argv[i], "-accelerate3d")) 221 233 { 222 234 if (a->argc <= i + 1) … … 225 237 accelerate3d = a->argv[i]; 226 238 } 227 else if (strcmp(a->argv[i], "-bioslogofadein") == 0) 239 else if ( !strcmp(a->argv[i], "--bioslogofadein") 240 || !strcmp(a->argv[i], "-bioslogofadein")) 228 241 { 229 242 if (a->argc <= i + 1) … … 232 245 bioslogofadein = a->argv[i]; 233 246 } 234 else if (strcmp(a->argv[i], "-bioslogofadeout") == 0) 247 else if ( !strcmp(a->argv[i], "--bioslogofadeout") 248 || !strcmp(a->argv[i], "-bioslogofadeout")) 235 249 { 236 250 if (a->argc <= i + 1) … … 239 253 bioslogofadeout = a->argv[i]; 240 254 } 241 else if (strcmp(a->argv[i], "-bioslogodisplaytime") == 0) 255 else if ( !strcmp(a->argv[i], "--bioslogodisplaytime") 256 || !strcmp(a->argv[i], "-bioslogodisplaytime")) 242 257 { 243 258 if (a->argc <= i + 1) … … 246 261 bioslogodisplaytime = RTStrToUInt32(a->argv[i]); 247 262 } 248 else if (strcmp(a->argv[i], "-bioslogoimagepath") == 0) 263 else if ( !strcmp(a->argv[i], "--bioslogoimagepath") 264 || !strcmp(a->argv[i], "-bioslogoimagepath")) 249 265 { 250 266 if (a->argc <= i + 1) … … 253 269 bioslogoimagepath = a->argv[i]; 254 270 } 255 else if (strcmp(a->argv[i], "-biosbootmenu") == 0) 271 else if ( !strcmp(a->argv[i], "--biosbootmenu") 272 || !strcmp(a->argv[i], "-biosbootmenu")) 256 273 { 257 274 if (a->argc <= i + 1) … … 260 277 biosbootmenumode = a->argv[i]; 261 278 } 262 else if (strcmp(a->argv[i], "-biossystemtimeoffset") == 0) 279 else if ( !strcmp(a->argv[i], "--biossystemtimeoffset") 280 || !strcmp(a->argv[i], "-biossystemtimeoffset")) 263 281 { 264 282 if (a->argc <= i + 1) … … 267 285 biossystemtimeoffset = a->argv[i]; 268 286 } 269 else if (strcmp(a->argv[i], "-biospxedebug") == 0) 287 else if ( !strcmp(a->argv[i], "--biospxedebug") 288 || !strcmp(a->argv[i], "-biospxedebug")) 270 289 { 271 290 if (a->argc <= i + 1) … … 274 293 biospxedebug = a->argv[i]; 275 294 } 276 else if (strncmp(a->argv[i], "-boot", 5) == 0) 295 else if ( !strncmp(a->argv[i], "--boot", 6) 296 || !strncmp(a->argv[i], "-boot", 5)) 277 297 { 278 298 uint32_t n = 0; 279 if (!a->argv[i][5 ])299 if (!a->argv[i][5 + (a->argv[i][1] == '-')]) 280 300 return errorSyntax(USAGE_MODIFYVM, "Missing boot slot number in '%s'", a->argv[i]); 281 if (VINF_SUCCESS != RTStrToUInt32Full(&a->argv[i][5 ], 10, &n))301 if (VINF_SUCCESS != RTStrToUInt32Full(&a->argv[i][5 + (a->argv[i][1] == '-')], 10, &n)) 282 302 return errorSyntax(USAGE_MODIFYVM, "Invalid boot slot number in '%s'", a->argv[i]); 283 303 if (a->argc <= i + 1) 284 304 return errorArgument("Missing argument to '%s'", a->argv[i]); 285 305 i++; 286 if ( strcmp(a->argv[i], "none") == 0)306 if (!strcmp(a->argv[i], "none")) 287 307 { 288 308 bootDevice[n - 1] = DeviceType_Null; 289 309 } 290 else if ( strcmp(a->argv[i], "floppy") == 0)310 else if (!strcmp(a->argv[i], "floppy")) 291 311 { 292 312 bootDevice[n - 1] = DeviceType_Floppy; 293 313 } 294 else if ( strcmp(a->argv[i], "dvd") == 0)314 else if (!strcmp(a->argv[i], "dvd")) 295 315 { 296 316 bootDevice[n - 1] = DeviceType_DVD; 297 317 } 298 else if ( strcmp(a->argv[i], "disk") == 0)318 else if (!strcmp(a->argv[i], "disk")) 299 319 { 300 320 bootDevice[n - 1] = DeviceType_HardDisk; 301 321 } 302 else if ( strcmp(a->argv[i], "net") == 0)322 else if (!strcmp(a->argv[i], "net")) 303 323 { 304 324 bootDevice[n - 1] = DeviceType_Network; … … 309 329 bootDeviceChanged[n - 1] = true; 310 330 } 311 else if (strcmp(a->argv[i], "-hda") == 0) 331 else if ( !strcmp(a->argv[i], "--hda") 332 || !strcmp(a->argv[i], "-hda")) 312 333 { 313 334 if (a->argc <= i + 1) … … 316 337 hdds[0] = a->argv[i]; 317 338 } 318 else if (strcmp(a->argv[i], "-hdb") == 0) 339 else if ( !strcmp(a->argv[i], "--hdb") 340 || !strcmp(a->argv[i], "-hdb")) 319 341 { 320 342 if (a->argc <= i + 1) … … 323 345 hdds[1] = a->argv[i]; 324 346 } 325 else if (strcmp(a->argv[i], "-hdd") == 0) 347 else if ( !strcmp(a->argv[i], "--hdd") 348 || !strcmp(a->argv[i], "-hdd")) 326 349 { 327 350 if (a->argc <= i + 1) … … 330 353 hdds[2] = a->argv[i]; 331 354 } 332 else if (strcmp(a->argv[i], "-dvd") == 0) 355 else if ( !strcmp(a->argv[i], "--dvd") 356 || !strcmp(a->argv[i], "-dvd")) 333 357 { 334 358 if (a->argc <= i + 1) … … 337 361 dvd = a->argv[i]; 338 362 } 339 else if (strcmp(a->argv[i], "-dvdpassthrough") == 0) 363 else if ( !strcmp(a->argv[i], "--dvdpassthrough") 364 || !strcmp(a->argv[i], "-dvdpassthrough")) 340 365 { 341 366 if (a->argc <= i + 1) … … 344 369 dvdpassthrough = a->argv[i]; 345 370 } 346 else if (strcmp(a->argv[i], "-idecontroller") == 0) 371 else if ( !strcmp(a->argv[i], "--idecontroller") 372 || !strcmp(a->argv[i], "-idecontroller")) 347 373 { 348 374 if (a->argc <= i + 1) … … 351 377 idecontroller = a->argv[i]; 352 378 } 353 else if (strcmp(a->argv[i], "-floppy") == 0) 379 else if ( !strcmp(a->argv[i], "--floppy") 380 || !strcmp(a->argv[i], "-floppy")) 354 381 { 355 382 if (a->argc <= i + 1) … … 358 385 floppy = a->argv[i]; 359 386 } 360 else if (strcmp(a->argv[i], "-audio") == 0) 387 else if ( !strcmp(a->argv[i], "--audio") 388 || !strcmp(a->argv[i], "-audio")) 361 389 { 362 390 if (a->argc <= i + 1) … … 365 393 audio = a->argv[i]; 366 394 } 367 else if (strcmp(a->argv[i], "-audiocontroller") == 0) 395 else if ( !strcmp(a->argv[i], "--audiocontroller") 396 || !strcmp(a->argv[i], "-audiocontroller")) 368 397 { 369 398 if (a->argc <= i + 1) … … 372 401 audiocontroller = a->argv[i]; 373 402 } 374 else if (strcmp(a->argv[i], "-clipboard") == 0) 403 else if ( !strcmp(a->argv[i], "--clipboard") 404 || !strcmp(a->argv[i], "-clipboard")) 375 405 { 376 406 if (a->argc <= i + 1) … … 379 409 clipboard = a->argv[i]; 380 410 } 381 else if (strncmp(a->argv[i], "-cableconnected", 15) == 0) 382 { 383 unsigned n = parseNum(&a->argv[i][15], NetworkAdapterCount, "NIC"); 411 else if ( !strncmp(a->argv[i], "--cableconnected", 16) 412 || !strncmp(a->argv[i], "-cableconnected", 15)) 413 { 414 unsigned n = parseNum(&a->argv[i][15 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 384 415 if (!n) 385 416 return 1; … … 391 422 i++; 392 423 } 393 /* watch for the right order of these -nic* comparisons! */ 394 else if (strncmp(a->argv[i], "-nictracefile", 13) == 0) 395 { 396 unsigned n = parseNum(&a->argv[i][13], NetworkAdapterCount, "NIC"); 424 /* watch for the right order of these --nic* comparisons! */ 425 else if ( !strncmp(a->argv[i], "--nictracefile", 14) 426 || !strncmp(a->argv[i], "-nictracefile", 13)) 427 { 428 unsigned n = parseNum(&a->argv[i][13 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 397 429 if (!n) 398 430 return 1; … … 404 436 i++; 405 437 } 406 else if (strncmp(a->argv[i], "-nictrace", 9) == 0) 407 { 408 unsigned n = parseNum(&a->argv[i][9], NetworkAdapterCount, "NIC"); 438 else if ( !strncmp(a->argv[i], "--nictrace", 10) 439 || !strncmp(a->argv[i], "-nictrace", 9)) 440 { 441 unsigned n = parseNum(&a->argv[i][9 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 409 442 if (!n) 410 443 return 1; … … 414 447 i++; 415 448 } 416 else if (strncmp(a->argv[i], "-nictype", 8) == 0) 417 { 418 unsigned n = parseNum(&a->argv[i][8], NetworkAdapterCount, "NIC"); 449 else if ( !strncmp(a->argv[i], "--nictype", 9) 450 || !strncmp(a->argv[i], "-nictype", 8)) 451 { 452 unsigned n = parseNum(&a->argv[i][8 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 419 453 if (!n) 420 454 return 1; … … 424 458 i++; 425 459 } 426 else if (strncmp(a->argv[i], "-nicspeed", 9) == 0) 427 { 428 unsigned n = parseNum(&a->argv[i][9], NetworkAdapterCount, "NIC"); 460 else if ( !strncmp(a->argv[i], "--nicspeed", 10) 461 || !strncmp(a->argv[i], "-nicspeed", 9)) 462 { 463 unsigned n = parseNum(&a->argv[i][9 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 429 464 if (!n) 430 465 return 1; … … 434 469 i++; 435 470 } 436 else if (strncmp(a->argv[i], "-nic", 4) == 0) 437 { 438 unsigned n = parseNum(&a->argv[i][4], NetworkAdapterCount, "NIC"); 471 else if ( !strncmp(a->argv[i], "--nic", 5) 472 || !strncmp(a->argv[i], "-nic", 4)) 473 { 474 unsigned n = parseNum(&a->argv[i][4 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 439 475 if (!n) 440 476 return 1; … … 444 480 i++; 445 481 } 446 else if (strncmp(a->argv[i], "-hostifdev", 10) == 0) /* backward compatibility */ 447 { 448 unsigned n = parseNum(&a->argv[i][10], NetworkAdapterCount, "NIC"); 482 else if ( !strncmp(a->argv[i], "--hostifdev", 11) 483 || !strncmp(a->argv[i], "-hostifdev", 10)) /* backward compatibility */ 484 { 485 unsigned n = parseNum(&a->argv[i][10 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 449 486 if (!n) 450 487 return 1; … … 454 491 i++; 455 492 } 456 else if ( strncmp(a->argv[i], "-bridgeadapter", 14) == 0) 457 { 458 unsigned n = parseNum(&a->argv[i][14], NetworkAdapterCount, "NIC"); 493 else if ( !strncmp(a->argv[i], "--bridgeadapter", 15) 494 || !strncmp(a->argv[i], "-bridgeadapter", 14)) 495 { 496 unsigned n = parseNum(&a->argv[i][14 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 459 497 if (!n) 460 498 return 1; … … 465 503 } 466 504 #if defined(VBOX_WITH_NETFLT) 467 else if (strncmp(a->argv[i], "-hostonlyadapter", 16) == 0) 468 { 469 unsigned n = parseNum(&a->argv[i][16], NetworkAdapterCount, "NIC"); 505 else if ( !strncmp(a->argv[i], "--hostonlyadapter", 17) 506 || !strncmp(a->argv[i], "-hostonlyadapter", 16)) 507 { 508 unsigned n = parseNum(&a->argv[i][16 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 470 509 if (!n) 471 510 return 1; … … 476 515 } 477 516 #endif 478 else if (strncmp(a->argv[i], "-intnet", 7) == 0) 479 { 480 unsigned n = parseNum(&a->argv[i][7], NetworkAdapterCount, "NIC"); 517 else if ( !strncmp(a->argv[i], "--intnet", 8) 518 || !strncmp(a->argv[i], "-intnet", 7)) 519 { 520 unsigned n = parseNum(&a->argv[i][7 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 481 521 if (!n) 482 522 return 1; … … 486 526 i++; 487 527 } 488 else if (strncmp(a->argv[i], "-natnet", 7) == 0) 489 { 490 unsigned n = parseNum(&a->argv[i][7], NetworkAdapterCount, "NIC"); 528 else if ( !strncmp(a->argv[i], "--natnet", 8) 529 || !strncmp(a->argv[i], "-natnet", 7)) 530 { 531 unsigned n = parseNum(&a->argv[i][7 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 491 532 if (!n) 492 533 return 1; … … 509 550 i++; 510 551 } 511 else if (strncmp(a->argv[i], "-macaddress", 11) == 0) 512 { 513 unsigned n = parseNum(&a->argv[i][11], NetworkAdapterCount, "NIC"); 552 else if ( !strncmp(a->argv[i], "--macaddress", 12) 553 || !strncmp(a->argv[i], "-macaddress", 11)) 554 { 555 unsigned n = parseNum(&a->argv[i][11 + (a->argv[i][1] == '-')], NetworkAdapterCount, "NIC"); 514 556 if (!n) 515 557 return 1; … … 520 562 } 521 563 #ifdef VBOX_WITH_VRDP 522 else if (strcmp(a->argv[i], "-vrdp") == 0) 564 else if ( !strcmp(a->argv[i], "--vrdp") 565 || !strcmp(a->argv[i], "-vrdp")) 523 566 { 524 567 if (a->argc <= i + 1) … … 527 570 vrdp = a->argv[i]; 528 571 } 529 else if (strcmp(a->argv[i], "-vrdpport") == 0) 530 { 531 if (a->argc <= i + 1) 532 return errorArgument("Missing argument to '%s'", a->argv[i]); 533 i++; 534 if (strcmp(a->argv[i], "default") == 0) 572 else if ( !strcmp(a->argv[i], "--vrdpport") 573 || !strcmp(a->argv[i], "-vrdpport")) 574 { 575 if (a->argc <= i + 1) 576 return errorArgument("Missing argument to '%s'", a->argv[i]); 577 i++; 578 if (!strcmp(a->argv[i], "default")) 535 579 vrdpport = 0; 536 580 else 537 581 vrdpport = RTStrToUInt16(a->argv[i]); 538 582 } 539 else if (strcmp(a->argv[i], "-vrdpaddress") == 0) 583 else if ( !strcmp(a->argv[i], "--vrdpaddress") 584 || !strcmp(a->argv[i], "-vrdpaddress")) 540 585 { 541 586 if (a->argc <= i + 1) … … 544 589 vrdpaddress = a->argv[i]; 545 590 } 546 else if (strcmp(a->argv[i], "-vrdpauthtype") == 0) 591 else if ( !strcmp(a->argv[i], "--vrdpauthtype") 592 || !strcmp(a->argv[i], "-vrdpauthtype")) 547 593 { 548 594 if (a->argc <= i + 1) … … 551 597 vrdpauthtype = a->argv[i]; 552 598 } 553 else if (strcmp(a->argv[i], "-vrdpmulticon") == 0) 599 else if ( !strcmp(a->argv[i], "--vrdpmulticon") 600 || !strcmp(a->argv[i], "-vrdpmulticon")) 554 601 { 555 602 if (a->argc <= i + 1) … … 558 605 vrdpmulticon = a->argv[i]; 559 606 } 560 else if (strcmp(a->argv[i], "-vrdpreusecon") == 0) 607 else if ( !strcmp(a->argv[i], "--vrdpreusecon") 608 || !strcmp(a->argv[i], "-vrdpreusecon")) 561 609 { 562 610 if (a->argc <= i + 1) … … 566 614 } 567 615 #endif /* VBOX_WITH_VRDP */ 568 else if (strcmp(a->argv[i], "-usb") == 0) 569 { 570 if (a->argc <= i + 1) 571 return errorArgument("Missing argument to '%s'", a->argv[i]); 572 i++; 573 if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0) 616 else if ( !strcmp(a->argv[i], "--usb") 617 || !strcmp(a->argv[i], "-usb")) 618 { 619 if (a->argc <= i + 1) 620 return errorArgument("Missing argument to '%s'", a->argv[i]); 621 i++; 622 if (!strcmp(a->argv[i], "on") || !strcmp(a->argv[i], "enable")) 574 623 fUsbEnabled = 1; 575 else if ( strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)624 else if (!strcmp(a->argv[i], "off") || !strcmp(a->argv[i], "disable")) 576 625 fUsbEnabled = 0; 577 626 else 578 return errorArgument("Invalid -usb argument '%s'", a->argv[i]); 579 } 580 else if (strcmp(a->argv[i], "-usbehci") == 0) 581 { 582 if (a->argc <= i + 1) 583 return errorArgument("Missing argument to '%s'", a->argv[i]); 584 i++; 585 if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0) 627 return errorArgument("Invalid --usb argument '%s'", a->argv[i]); 628 } 629 else if ( !strcmp(a->argv[i], "--usbehci") 630 || !strcmp(a->argv[i], "-usbehci")) 631 { 632 if (a->argc <= i + 1) 633 return errorArgument("Missing argument to '%s'", a->argv[i]); 634 i++; 635 if (!strcmp(a->argv[i], "on") || !strcmp(a->argv[i], "enable")) 586 636 fUsbEhciEnabled = 1; 587 else if ( strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)637 else if (!strcmp(a->argv[i], "off") || !strcmp(a->argv[i], "disable")) 588 638 fUsbEhciEnabled = 0; 589 639 else 590 return errorArgument("Invalid -usbehci argument '%s'", a->argv[i]); 591 } 592 else if (strcmp(a->argv[i], "-snapshotfolder") == 0) 640 return errorArgument("Invalid --usbehci argument '%s'", a->argv[i]); 641 } 642 else if ( !strcmp(a->argv[i], "--snapshotfolder") 643 || !strcmp(a->argv[i], "-snapshotfolder")) 593 644 { 594 645 if (a->argc <= i + 1) … … 597 648 snapshotFolder = a->argv[i]; 598 649 } 599 else if (strncmp(a->argv[i], "-uartmode", 9) == 0) 600 { 601 unsigned n = parseNum(&a->argv[i][9], SerialPortCount, "UART"); 650 else if ( !strncmp(a->argv[i], "--uartmode", 10) 651 || !strncmp(a->argv[i], "-uartmode", 9)) 652 { 653 unsigned n = parseNum(&a->argv[i][9 + (a->argv[i][1] == '-')], SerialPortCount, "UART"); 602 654 if (!n) 603 655 return 1; 604 656 i++; 605 if ( strcmp(a->argv[i], "disconnected") == 0)657 if (!strcmp(a->argv[i], "disconnected")) 606 658 { 607 659 uarts_mode[n - 1] = a->argv[i]; … … 609 661 else 610 662 { 611 if ( strcmp(a->argv[i], "server") == 0 || strcmp(a->argv[i], "client") == 0)663 if (!strcmp(a->argv[i], "server") || !strcmp(a->argv[i], "client")) 612 664 { 613 665 uarts_mode[n - 1] = a->argv[i]; 614 666 i++; 615 667 #ifdef RT_OS_WINDOWS 616 if ( strncmp(a->argv[i], "\\\\.\\pipe\\", 9))668 if (!strncmp(a->argv[i], "\\\\.\\pipe\\", 9)) 617 669 return errorArgument("Uart pipe must start with \\\\.\\pipe\\"); 618 670 #endif … … 623 675 } 624 676 if (a->argc <= i) 625 return errorArgument("Missing argument to - uartmode");677 return errorArgument("Missing argument to --uartmode"); 626 678 uarts_path[n - 1] = a->argv[i]; 627 679 } 628 680 } 629 else if (strncmp(a->argv[i], "-uart", 5) == 0) 630 { 631 unsigned n = parseNum(&a->argv[i][5], SerialPortCount, "UART"); 681 else if ( !strncmp(a->argv[i], "--uart", 6) 682 || !strncmp(a->argv[i], "-uart", 5)) 683 { 684 unsigned n = parseNum(&a->argv[i][5 + (a->argv[i][1] == '-')], SerialPortCount, "UART"); 632 685 if (!n) 633 686 return 1; … … 635 688 return errorArgument("Missing argument to '%s'", a->argv[i]); 636 689 i++; 637 if ( strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)690 if (!strcmp(a->argv[i], "off") || !strcmp(a->argv[i], "disable")) 638 691 { 639 692 uarts_base[n - 1] = (ULONG)-1; … … 657 710 } 658 711 #ifdef VBOX_WITH_MEM_BALLOONING 659 else if (strncmp(a->argv[i], "-guestmemoryballoon", 19) == 0) 712 else if ( !strcmp(a->argv[i], "--guestmemoryballoon") 713 || !strcmp(a->argv[i], "-guestmemoryballoon")) 660 714 { 661 715 if (a->argc <= i + 1) … … 670 724 } 671 725 #endif 672 else if (strncmp(a->argv[i], "-gueststatisticsinterval", 24) == 0) 726 else if ( !strcmp(a->argv[i], "--gueststatisticsinterval") 727 || !strcmp(a->argv[i], "-gueststatisticsinterval")) 673 728 { 674 729 if (a->argc <= i + 1) … … 682 737 guestStatInterval = uVal; 683 738 } 684 else if (strcmp(a->argv[i], "-sata") == 0) 685 { 686 if (a->argc <= i + 1) 687 return errorArgument("Missing argument to '%s'", a->argv[i]); 688 i++; 689 if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0) 739 else if ( !strcmp(a->argv[i], "--sata") 740 || !strcmp(a->argv[i], "-sata")) 741 { 742 if (a->argc <= i + 1) 743 return errorArgument("Missing argument to '%s'", a->argv[i]); 744 i++; 745 if (!strcmp(a->argv[i], "on") || !strcmp(a->argv[i], "enable")) 690 746 fSataEnabled = 1; 691 else if ( strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)747 else if (!strcmp(a->argv[i], "off") || !strcmp(a->argv[i], "disable")) 692 748 fSataEnabled = 0; 693 749 else 694 return errorArgument("Invalid -usb argument '%s'", a->argv[i]); 695 } 696 else if (strcmp(a->argv[i], "-sataportcount") == 0) 750 return errorArgument("Invalid --usb argument '%s'", a->argv[i]); 751 } 752 else if ( !strcmp(a->argv[i], "--sataportcount") 753 || !strcmp(a->argv[i], "-sataportcount")) 697 754 { 698 755 unsigned n; … … 707 764 sataPortCount = n; 708 765 } 709 else if (strncmp(a->argv[i], "-sataport", 9) == 0) 710 { 711 unsigned n = parseNum(&a->argv[i][9], 30, "SATA"); 766 else if ( !strncmp(a->argv[i], "--sataport", 10) 767 || !strncmp(a->argv[i], "-sataport", 9)) 768 { 769 unsigned n = parseNum(&a->argv[i][9 + (a->argv[i][1] == '-')], 30, "SATA"); 712 770 if (!n) 713 771 return 1; … … 717 775 hdds[n-1+4] = a->argv[i]; 718 776 } 719 else if (strncmp(a->argv[i], "-sataideemulation", 17) == 0) 777 else if ( !strncmp(a->argv[i], "--sataideemulation", 18) 778 || !strncmp(a->argv[i], "-sataideemulation", 17)) 720 779 { 721 780 unsigned bootDevicePos = 0; 722 781 unsigned n; 723 782 724 bootDevicePos = parseNum(&a->argv[i][17 ], 4, "SATA");783 bootDevicePos = parseNum(&a->argv[i][17 + (a->argv[i][1] == '-')], 4, "SATA"); 725 784 if (!bootDevicePos) 726 785 return 1; … … 737 796 sataBootDevices[bootDevicePos] = n-1; 738 797 } 739 else if (strcmp(a->argv[i], "-scsi") == 0) 740 { 741 if (a->argc <= i + 1) 742 return errorArgument("Missing argument to '%s'", a->argv[i]); 743 i++; 744 if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0) 798 else if ( !strcmp(a->argv[i], "--scsi") 799 || !strcmp(a->argv[i], "-scsi")) 800 { 801 if (a->argc <= i + 1) 802 return errorArgument("Missing argument to '%s'", a->argv[i]); 803 i++; 804 if (!strcmp(a->argv[i], "on") || !strcmp(a->argv[i], "enable")) 745 805 fScsiEnabled = 1; 746 else if ( strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)806 else if (!strcmp(a->argv[i], "off") || !strcmp(a->argv[i], "disable")) 747 807 fScsiEnabled = 0; 748 808 else 749 return errorArgument("Invalid -scsi argument '%s'", a->argv[i]); 750 } 751 else if (strncmp(a->argv[i], "-scsiport", 9) == 0) 752 { 753 unsigned n = parseNum(&a->argv[i][9], 16, "SCSI"); 809 return errorArgument("Invalid --scsi argument '%s'", a->argv[i]); 810 } 811 else if ( !strncmp(a->argv[i], "--scsiport", 10) 812 || !strncmp(a->argv[i], "-scsiport", 9)) 813 { 814 unsigned n = parseNum(&a->argv[i][9 + (a->argv[i][1] == '-')], 16, "SCSI"); 754 815 if (!n) 755 816 return 1; … … 759 820 hdds[n-1+34] = a->argv[i]; 760 821 } 761 else if (strcmp(a->argv[i], "-scsitype") == 0) 762 { 763 if (a->argc <= i + 1) 764 return errorArgument("Missing argument to '%s'", a->argv[i]); 765 i++; 766 if (strcmp(a->argv[i], "LsiLogic") == 0 ) 822 else if ( !strcmp(a->argv[i], "--scsitype") 823 || !strcmp(a->argv[i], "-scsitype")) 824 { 825 if (a->argc <= i + 1) 826 return errorArgument("Missing argument to '%s'", a->argv[i]); 827 i++; 828 if (!RTStrICmp(a->argv[i], "LsiLogic")) 767 829 fScsiLsiLogic = 1; 768 else if ( strcmp(a->argv[i], "BusLogic") == 0)830 else if (!RTStrICmp(a->argv[i], "BusLogic")) 769 831 fScsiLsiLogic = 0; 770 832 else 771 return errorArgument("Invalid - scsitype argument '%s'", a->argv[i]);833 return errorArgument("Invalid --scsitype argument '%s'", a->argv[i]); 772 834 } 773 835 else … … 825 887 if (acpi) 826 888 { 827 if ( strcmp(acpi, "on") == 0)889 if (!strcmp(acpi, "on")) 828 890 { 829 891 CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(true)); 830 892 } 831 else if ( strcmp(acpi, "off") == 0)893 else if (!strcmp(acpi, "off")) 832 894 { 833 895 CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(false)); … … 835 897 else 836 898 { 837 errorArgument("Invalid - acpi argument '%s'", acpi);899 errorArgument("Invalid --acpi argument '%s'", acpi); 838 900 rc = E_FAIL; 839 901 break; … … 842 904 if (ioapic) 843 905 { 844 if ( strcmp(ioapic, "on") == 0)906 if (!strcmp(ioapic, "on")) 845 907 { 846 908 CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(true)); 847 909 } 848 else if ( strcmp(ioapic, "off") == 0)910 else if (!strcmp(ioapic, "off")) 849 911 { 850 912 CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(false)); … … 852 914 else 853 915 { 854 errorArgument("Invalid - ioapic argument '%s'", ioapic);916 errorArgument("Invalid --ioapic argument '%s'", ioapic); 855 917 rc = E_FAIL; 856 918 break; … … 859 921 if (hwvirtex) 860 922 { 861 if ( strcmp(hwvirtex, "on") == 0)923 if (!strcmp(hwvirtex, "on")) 862 924 { 863 925 CHECK_ERROR(machine, COMSETTER(HWVirtExEnabled)(TSBool_True)); 864 926 } 865 else if ( strcmp(hwvirtex, "off") == 0)927 else if (!strcmp(hwvirtex, "off")) 866 928 { 867 929 CHECK_ERROR(machine, COMSETTER(HWVirtExEnabled)(TSBool_False)); 868 930 } 869 else if ( strcmp(hwvirtex, "default") == 0)931 else if (!strcmp(hwvirtex, "default")) 870 932 { 871 933 CHECK_ERROR(machine, COMSETTER(HWVirtExEnabled)(TSBool_Default)); … … 873 935 else 874 936 { 875 errorArgument("Invalid - hwvirtex argument '%s'", hwvirtex);937 errorArgument("Invalid --hwvirtex argument '%s'", hwvirtex); 876 938 rc = E_FAIL; 877 939 break; … … 880 942 if (nestedpaging) 881 943 { 882 if ( strcmp(nestedpaging, "on") == 0)944 if (!strcmp(nestedpaging, "on")) 883 945 { 884 946 CHECK_ERROR(machine, COMSETTER(HWVirtExNestedPagingEnabled)(true)); 885 947 } 886 else if ( strcmp(nestedpaging, "off") == 0)948 else if (!strcmp(nestedpaging, "off")) 887 949 { 888 950 CHECK_ERROR(machine, COMSETTER(HWVirtExNestedPagingEnabled)(false)); … … 890 952 else 891 953 { 892 errorArgument("Invalid - nestedpaging argument '%s'", ioapic);954 errorArgument("Invalid --nestedpaging argument '%s'", ioapic); 893 955 rc = E_FAIL; 894 956 break; … … 897 959 if (vtxvpid) 898 960 { 899 if ( strcmp(vtxvpid, "on") == 0)961 if (!strcmp(vtxvpid, "on")) 900 962 { 901 963 CHECK_ERROR(machine, COMSETTER(HWVirtExVPIDEnabled)(true)); 902 964 } 903 else if ( strcmp(vtxvpid, "off") == 0)965 else if (!strcmp(vtxvpid, "off")) 904 966 { 905 967 CHECK_ERROR(machine, COMSETTER(HWVirtExVPIDEnabled)(false)); … … 907 969 else 908 970 { 909 errorArgument("Invalid - vtxvpid argument '%s'", ioapic);971 errorArgument("Invalid --vtxvpid argument '%s'", ioapic); 910 972 rc = E_FAIL; 911 973 break; … … 914 976 if (pae) 915 977 { 916 if ( strcmp(pae, "on") == 0)978 if (!strcmp(pae, "on")) 917 979 { 918 980 CHECK_ERROR(machine, COMSETTER(PAEEnabled)(true)); 919 981 } 920 else if ( strcmp(pae, "off") == 0)982 else if (!strcmp(pae, "off")) 921 983 { 922 984 CHECK_ERROR(machine, COMSETTER(PAEEnabled)(false)); … … 924 986 else 925 987 { 926 errorArgument("Invalid - pae argument '%s'", ioapic);988 errorArgument("Invalid --pae argument '%s'", ioapic); 927 989 rc = E_FAIL; 928 990 break; … … 935 997 if (accelerate3d) 936 998 { 937 if ( strcmp(accelerate3d, "on") == 0)999 if (!strcmp(accelerate3d, "on")) 938 1000 { 939 1001 CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(true)); 940 1002 } 941 else if ( strcmp(accelerate3d, "off") == 0)1003 else if (!strcmp(accelerate3d, "off")) 942 1004 { 943 1005 CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(false)); … … 945 1007 else 946 1008 { 947 errorArgument("Invalid - accelerate3d argument '%s'", ioapic);1009 errorArgument("Invalid --accelerate3d argument '%s'", ioapic); 948 1010 rc = E_FAIL; 949 1011 break; … … 952 1014 if (bioslogofadein) 953 1015 { 954 if ( strcmp(bioslogofadein, "on") == 0)1016 if (!strcmp(bioslogofadein, "on")) 955 1017 { 956 1018 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(true)); 957 1019 } 958 else if ( strcmp(bioslogofadein, "off") == 0)1020 else if (!strcmp(bioslogofadein, "off")) 959 1021 { 960 1022 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(false)); … … 962 1024 else 963 1025 { 964 errorArgument("Invalid - bioslogofadein argument '%s'", bioslogofadein);1026 errorArgument("Invalid --bioslogofadein argument '%s'", bioslogofadein); 965 1027 rc = E_FAIL; 966 1028 break; … … 969 1031 if (bioslogofadeout) 970 1032 { 971 if ( strcmp(bioslogofadeout, "on") == 0)1033 if (!strcmp(bioslogofadeout, "on")) 972 1034 { 973 1035 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(true)); 974 1036 } 975 else if ( strcmp(bioslogofadeout, "off") == 0)1037 else if (!strcmp(bioslogofadeout, "off")) 976 1038 { 977 1039 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(false)); … … 979 1041 else 980 1042 { 981 errorArgument("Invalid - bioslogofadeout argument '%s'", bioslogofadeout);1043 errorArgument("Invalid --bioslogofadeout argument '%s'", bioslogofadeout); 982 1044 rc = E_FAIL; 983 1045 break; … … 994 1056 if (biosbootmenumode) 995 1057 { 996 if ( strcmp(biosbootmenumode, "disabled") == 0)1058 if (!strcmp(biosbootmenumode, "disabled")) 997 1059 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_Disabled)); 998 else if ( strcmp(biosbootmenumode, "menuonly") == 0)1060 else if (!strcmp(biosbootmenumode, "menuonly")) 999 1061 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MenuOnly)); 1000 else if ( strcmp(biosbootmenumode, "messageandmenu") == 0)1062 else if (!strcmp(biosbootmenumode, "messageandmenu")) 1001 1063 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MessageAndMenu)); 1002 1064 else 1003 1065 { 1004 errorArgument("Invalid - biosbootmenu argument '%s'", biosbootmenumode);1066 errorArgument("Invalid --biosbootmenu argument '%s'", biosbootmenumode); 1005 1067 rc = E_FAIL; 1006 1068 break; … … 1015 1077 if (biospxedebug) 1016 1078 { 1017 if ( strcmp(biospxedebug, "on") == 0)1079 if (!strcmp(biospxedebug, "on")) 1018 1080 { 1019 1081 CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(true)); 1020 1082 } 1021 else if ( strcmp(biospxedebug, "off") == 0)1083 else if (!strcmp(biospxedebug, "off")) 1022 1084 { 1023 1085 CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(false)); … … 1025 1087 else 1026 1088 { 1027 errorArgument("Invalid - biospxedebug argument '%s'", biospxedebug);1089 errorArgument("Invalid --biospxedebug argument '%s'", biospxedebug); 1028 1090 rc = E_FAIL; 1029 1091 break; … … 1037 1099 if (hdds[0]) 1038 1100 { 1039 if ( strcmp(hdds[0], "none") == 0)1101 if (!strcmp(hdds[0], "none")) 1040 1102 { 1041 1103 machine->DetachHardDisk(Bstr("IDE"), 0, 0); … … 1070 1132 if (hdds[1]) 1071 1133 { 1072 if ( strcmp(hdds[1], "none") == 0)1134 if (!strcmp(hdds[1], "none")) 1073 1135 { 1074 1136 machine->DetachHardDisk(Bstr("IDE"), 0, 1); … … 1103 1165 if (hdds[2]) 1104 1166 { 1105 if ( strcmp(hdds[2], "none") == 0)1167 if (!strcmp(hdds[2], "none")) 1106 1168 { 1107 1169 machine->DetachHardDisk(Bstr("IDE"), 1, 1); … … 1141 1203 1142 1204 /* unmount? */ 1143 if ( strcmp(dvd, "none") == 0)1205 if (!strcmp(dvd, "none")) 1144 1206 { 1145 1207 CHECK_ERROR(dvdDrive, Unmount()); 1146 1208 } 1147 1209 /* host drive? */ 1148 else if ( strncmp(dvd, "host:", 5) == 0)1210 else if (!strncmp(dvd, "host:", 5)) 1149 1211 { 1150 1212 ComPtr<IHost> host; … … 1208 1270 ASSERT(dvdDrive); 1209 1271 1210 CHECK_ERROR(dvdDrive, COMSETTER(Passthrough)( strcmp(dvdpassthrough, "on") == 0));1272 CHECK_ERROR(dvdDrive, COMSETTER(Passthrough)(!strcmp(dvdpassthrough, "on"))); 1211 1273 } 1212 1274 if (idecontroller) … … 1215 1277 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE"), storageController.asOutParam())); 1216 1278 1217 if (RTStrICmp(idecontroller, "PIIX3") == 0)1279 if (RTStrICmp(idecontroller, "PIIX3")) 1218 1280 { 1219 1281 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX3)); 1220 1282 } 1221 else if (RTStrICmp(idecontroller, "PIIX4") == 0)1283 else if (RTStrICmp(idecontroller, "PIIX4")) 1222 1284 { 1223 1285 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX4)); 1224 1286 } 1225 else if (RTStrICmp(idecontroller, "ICH6") == 0)1287 else if (RTStrICmp(idecontroller, "ICH6")) 1226 1288 { 1227 1289 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_ICH6)); … … 1229 1291 else 1230 1292 { 1231 errorArgument("Invalid - idecontroller argument '%s'", idecontroller);1293 errorArgument("Invalid --idecontroller argument '%s'", idecontroller); 1232 1294 rc = E_FAIL; 1233 1295 break; … … 1241 1303 1242 1304 /* disable? */ 1243 if ( strcmp(floppy, "disabled") == 0)1305 if (!strcmp(floppy, "disabled")) 1244 1306 { 1245 1307 /* disable the controller */ … … 1252 1314 1253 1315 /* unmount? */ 1254 if ( strcmp(floppy, "empty") == 0)1316 if (!strcmp(floppy, "empty")) 1255 1317 { 1256 1318 CHECK_ERROR(floppyDrive, Unmount()); 1257 1319 } 1258 1320 /* host drive? */ 1259 else if ( strncmp(floppy, "host:", 5) == 0)1321 else if (!strncmp(floppy, "host:", 5)) 1260 1322 { 1261 1323 ComPtr<IHost> host; … … 1310 1372 { 1311 1373 /* disable? */ 1312 if ( strcmp(audio, "none") == 0)1374 if (!strcmp(audio, "none")) 1313 1375 { 1314 1376 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(false)); 1315 1377 } 1316 else if ( strcmp(audio, "null") == 0)1378 else if (!strcmp(audio, "null")) 1317 1379 { 1318 1380 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_Null)); … … 1321 1383 #ifdef RT_OS_WINDOWS 1322 1384 #ifdef VBOX_WITH_WINMM 1323 else if ( strcmp(audio, "winmm") == 0)1385 else if (!strcmp(audio, "winmm")) 1324 1386 { 1325 1387 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_WinMM)); … … 1327 1389 } 1328 1390 #endif 1329 else if ( strcmp(audio, "dsound") == 0)1391 else if (!strcmp(audio, "dsound")) 1330 1392 { 1331 1393 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_DirectSound)); … … 1334 1396 #endif /* RT_OS_WINDOWS */ 1335 1397 #ifdef RT_OS_LINUX 1336 else if ( strcmp(audio, "oss") == 0)1398 else if (!strcmp(audio, "oss")) 1337 1399 { 1338 1400 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_OSS)); … … 1340 1402 } 1341 1403 # ifdef VBOX_WITH_ALSA 1342 else if ( strcmp(audio, "alsa") == 0)1404 else if (!strcmp(audio, "alsa")) 1343 1405 { 1344 1406 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_ALSA)); … … 1347 1409 # endif 1348 1410 # ifdef VBOX_WITH_PULSE 1349 else if ( strcmp(audio, "pulse") == 0)1411 else if (!strcmp(audio, "pulse")) 1350 1412 { 1351 1413 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_Pulse)); … … 1355 1417 #endif /* !RT_OS_LINUX */ 1356 1418 #ifdef RT_OS_SOLARIS 1357 else if ( strcmp(audio, "solaudio") == 0)1419 else if (!strcmp(audio, "solaudio")) 1358 1420 { 1359 1421 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_SolAudio)); … … 1363 1425 #endif /* !RT_OS_SOLARIS */ 1364 1426 #ifdef RT_OS_DARWIN 1365 else if ( strcmp(audio, "coreaudio") == 0)1427 else if (!strcmp(audio, "coreaudio")) 1366 1428 { 1367 1429 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_CoreAudio)); … … 1372 1434 else 1373 1435 { 1374 errorArgument("Invalid - audio argument '%s'", audio);1436 errorArgument("Invalid --audio argument '%s'", audio); 1375 1437 rc = E_FAIL; 1376 1438 break; … … 1379 1441 if (audiocontroller) 1380 1442 { 1381 if ( strcmp(audiocontroller, "sb16") == 0)1443 if (!strcmp(audiocontroller, "sb16")) 1382 1444 CHECK_ERROR(audioAdapter, COMSETTER(AudioController)(AudioControllerType_SB16)); 1383 else if ( strcmp(audiocontroller, "ac97") == 0)1445 else if (!strcmp(audiocontroller, "ac97")) 1384 1446 CHECK_ERROR(audioAdapter, COMSETTER(AudioController)(AudioControllerType_AC97)); 1385 1447 else 1386 1448 { 1387 errorArgument("Invalid - audiocontroller argument '%s'", audiocontroller);1449 errorArgument("Invalid --audiocontroller argument '%s'", audiocontroller); 1388 1450 rc = E_FAIL; 1389 1451 break; … … 1398 1460 ASSERT(clipboardMode); 1399 1461 */ 1400 if ( strcmp(clipboard, "disabled") == 0)1462 if (!strcmp(clipboard, "disabled")) 1401 1463 { 1402 1464 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_Disabled)); 1403 1465 } 1404 else if ( strcmp(clipboard, "hosttoguest") == 0)1466 else if (!strcmp(clipboard, "hosttoguest")) 1405 1467 { 1406 1468 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_HostToGuest)); 1407 1469 } 1408 else if ( strcmp(clipboard, "guesttohost") == 0)1470 else if (!strcmp(clipboard, "guesttohost")) 1409 1471 { 1410 1472 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_GuestToHost)); 1411 1473 } 1412 else if ( strcmp(clipboard, "bidirectional") == 0)1474 else if (!strcmp(clipboard, "bidirectional")) 1413 1475 { 1414 1476 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_Bidirectional)); … … 1416 1478 else 1417 1479 { 1418 errorArgument("Invalid - clipboard argument '%s'", clipboard);1480 errorArgument("Invalid --clipboard argument '%s'", clipboard); 1419 1481 rc = E_FAIL; 1420 1482 break; … … 1432 1494 if (nics[n]) 1433 1495 { 1434 if ( strcmp(nics[n], "none") == 0)1496 if (!strcmp(nics[n], "none")) 1435 1497 { 1436 1498 CHECK_ERROR_RET(nic, COMSETTER(Enabled) (FALSE), 1); 1437 1499 } 1438 else if ( strcmp(nics[n], "null") == 0)1500 else if (!strcmp(nics[n], "null")) 1439 1501 { 1440 1502 CHECK_ERROR_RET(nic, COMSETTER(Enabled) (TRUE), 1); 1441 1503 CHECK_ERROR_RET(nic, Detach(), 1); 1442 1504 } 1443 else if ( strcmp(nics[n], "nat") == 0)1505 else if (!strcmp(nics[n], "nat")) 1444 1506 { 1445 1507 CHECK_ERROR_RET(nic, COMSETTER(Enabled) (TRUE), 1); 1446 1508 CHECK_ERROR_RET(nic, AttachToNAT(), 1); 1447 1509 } 1448 else if ( strcmp(nics[n], "bridged") == 01449 || strcmp(nics[n], "hostif") == 0) /* backward compatibility */1510 else if ( !strcmp(nics[n], "bridged") 1511 || !strcmp(nics[n], "hostif")) /* backward compatibility */ 1450 1512 { 1451 1513 CHECK_ERROR_RET(nic, COMSETTER(Enabled) (TRUE), 1); 1452 1514 CHECK_ERROR_RET(nic, AttachToBridgedInterface(), 1); 1453 1515 } 1454 else if ( strcmp(nics[n], "intnet") == 0)1516 else if (!strcmp(nics[n], "intnet")) 1455 1517 { 1456 1518 CHECK_ERROR_RET(nic, COMSETTER(Enabled) (TRUE), 1); … … 1458 1520 } 1459 1521 #if defined(VBOX_WITH_NETFLT) 1460 else if ( strcmp(nics[n], "hostonly") == 0)1522 else if (!strcmp(nics[n], "hostonly")) 1461 1523 { 1462 1524 … … 1476 1538 if (nictype[n]) 1477 1539 { 1478 if ( strcmp(nictype[n], "Am79C970A") == 0)1540 if (!strcmp(nictype[n], "Am79C970A")) 1479 1541 { 1480 1542 CHECK_ERROR_RET(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C970A), 1); 1481 1543 } 1482 else if ( strcmp(nictype[n], "Am79C973") == 0)1544 else if (!strcmp(nictype[n], "Am79C973")) 1483 1545 { 1484 1546 CHECK_ERROR_RET(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C973), 1); 1485 1547 } 1486 1548 #ifdef VBOX_WITH_E1000 1487 else if ( strcmp(nictype[n], "82540EM") == 0)1549 else if (!strcmp(nictype[n], "82540EM")) 1488 1550 { 1489 1551 CHECK_ERROR_RET(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82540EM), 1); 1490 1552 } 1491 else if ( strcmp(nictype[n], "82543GC") == 0)1553 else if (!strcmp(nictype[n], "82543GC")) 1492 1554 { 1493 1555 CHECK_ERROR_RET(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82543GC), 1); 1494 1556 } 1495 else if ( strcmp(nictype[n], "82545EM") == 0)1557 else if (!strcmp(nictype[n], "82545EM")) 1496 1558 { 1497 1559 CHECK_ERROR_RET(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82545EM), 1); … … 1510 1572 { 1511 1573 /* generate one? */ 1512 if ( strcmp(macs[n], "auto") == 0)1574 if (!strcmp(macs[n], "auto")) 1513 1575 { 1514 1576 CHECK_ERROR_RET(nic, COMSETTER(MACAddress)(NULL), 1); … … 1529 1591 if (u32LineSpeed < 1000 || u32LineSpeed > 4000000) 1530 1592 { 1531 errorArgument("Invalid - nicspeed%lu argument '%s'", n + 1, nicspeed[n]);1593 errorArgument("Invalid --nicspeed%lu argument '%s'", n + 1, nicspeed[n]); 1532 1594 rc = E_FAIL; 1533 1595 break; … … 1539 1601 if (cableconnected[n]) 1540 1602 { 1541 if ( strcmp(cableconnected[n], "on") == 0)1603 if (!strcmp(cableconnected[n], "on")) 1542 1604 { 1543 1605 CHECK_ERROR_RET(nic, COMSETTER(CableConnected)(TRUE), 1); 1544 1606 } 1545 else if ( strcmp(cableconnected[n], "off") == 0)1607 else if (!strcmp(cableconnected[n], "off")) 1546 1608 { 1547 1609 CHECK_ERROR_RET(nic, COMSETTER(CableConnected)(FALSE), 1); … … 1549 1611 else 1550 1612 { 1551 errorArgument("Invalid - cableconnected%lu argument '%s'", n + 1, cableconnected[n]);1613 errorArgument("Invalid --cableconnected%lu argument '%s'", n + 1, cableconnected[n]); 1552 1614 rc = E_FAIL; 1553 1615 break; … … 1558 1620 if (nictrace[n]) 1559 1621 { 1560 if ( strcmp(nictrace[n], "on") == 0)1622 if (!strcmp(nictrace[n], "on")) 1561 1623 { 1562 1624 CHECK_ERROR_RET(nic, COMSETTER(TraceEnabled)(TRUE), 1); 1563 1625 } 1564 else if ( strcmp(nictrace[n], "off") == 0)1626 else if (!strcmp(nictrace[n], "off")) 1565 1627 { 1566 1628 CHECK_ERROR_RET(nic, COMSETTER(TraceEnabled)(FALSE), 1); … … 1568 1630 else 1569 1631 { 1570 errorArgument("Invalid - nictrace%lu argument '%s'", n + 1, nictrace[n]);1632 errorArgument("Invalid --nictrace%lu argument '%s'", n + 1, nictrace[n]); 1571 1633 rc = E_FAIL; 1572 1634 break; … … 1584 1646 { 1585 1647 /* remove it? */ 1586 if ( strcmp(hostifdev[n], "none") == 0)1648 if (!strcmp(hostifdev[n], "none")) 1587 1649 { 1588 1650 CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(NULL), 1); … … 1598 1660 { 1599 1661 /* remove it? */ 1600 if ( strcmp(intnet[n], "none") == 0)1662 if (!strcmp(intnet[n], "none")) 1601 1663 { 1602 1664 CHECK_ERROR_RET(nic, COMSETTER(InternalNetwork)(NULL), 1); … … 1639 1701 if (uarts_mode[n]) 1640 1702 { 1641 if ( strcmp(uarts_mode[n], "disconnected") == 0)1703 if (!strcmp(uarts_mode[n], "disconnected")) 1642 1704 { 1643 1705 CHECK_ERROR_RET(uart, COMSETTER(HostMode) (PortMode_Disconnected), 1); … … 1646 1708 { 1647 1709 CHECK_ERROR_RET(uart, COMSETTER(Path) (Bstr(uarts_path[n])), 1); 1648 if ( strcmp(uarts_mode[n], "server") == 0)1710 if (!strcmp(uarts_mode[n], "server")) 1649 1711 { 1650 1712 CHECK_ERROR_RET(uart, COMSETTER(HostMode) (PortMode_HostPipe), 1); 1651 1713 CHECK_ERROR_RET(uart, COMSETTER(Server) (TRUE), 1); 1652 1714 } 1653 else if ( strcmp(uarts_mode[n], "client") == 0)1715 else if (!strcmp(uarts_mode[n], "client")) 1654 1716 { 1655 1717 CHECK_ERROR_RET(uart, COMSETTER(HostMode) (PortMode_HostPipe), 1); … … 1676 1738 if (vrdp) 1677 1739 { 1678 if ( strcmp(vrdp, "on") == 0)1740 if (!strcmp(vrdp, "on")) 1679 1741 { 1680 1742 CHECK_ERROR(vrdpServer, COMSETTER(Enabled)(true)); 1681 1743 } 1682 else if ( strcmp(vrdp, "off") == 0)1744 else if (!strcmp(vrdp, "off")) 1683 1745 { 1684 1746 CHECK_ERROR(vrdpServer, COMSETTER(Enabled)(false)); … … 1686 1748 else 1687 1749 { 1688 errorArgument("Invalid - vrdp argument '%s'", vrdp);1750 errorArgument("Invalid --vrdp argument '%s'", vrdp); 1689 1751 rc = E_FAIL; 1690 1752 break; … … 1701 1763 if (vrdpauthtype) 1702 1764 { 1703 if ( strcmp(vrdpauthtype, "null") == 0)1765 if (!strcmp(vrdpauthtype, "null")) 1704 1766 { 1705 1767 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_Null)); 1706 1768 } 1707 else if ( strcmp(vrdpauthtype, "external") == 0)1769 else if (!strcmp(vrdpauthtype, "external")) 1708 1770 { 1709 1771 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_External)); 1710 1772 } 1711 else if ( strcmp(vrdpauthtype, "guest") == 0)1773 else if (!strcmp(vrdpauthtype, "guest")) 1712 1774 { 1713 1775 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_Guest)); … … 1715 1777 else 1716 1778 { 1717 errorArgument("Invalid - vrdpauthtype argument '%s'", vrdpauthtype);1779 errorArgument("Invalid --vrdpauthtype argument '%s'", vrdpauthtype); 1718 1780 rc = E_FAIL; 1719 1781 break; … … 1722 1784 if (vrdpmulticon) 1723 1785 { 1724 if ( strcmp(vrdpmulticon, "on") == 0)1786 if (!strcmp(vrdpmulticon, "on")) 1725 1787 { 1726 1788 CHECK_ERROR(vrdpServer, COMSETTER(AllowMultiConnection)(true)); 1727 1789 } 1728 else if ( strcmp(vrdpmulticon, "off") == 0)1790 else if (!strcmp(vrdpmulticon, "off")) 1729 1791 { 1730 1792 CHECK_ERROR(vrdpServer, COMSETTER(AllowMultiConnection)(false)); … … 1732 1794 else 1733 1795 { 1734 errorArgument("Invalid - vrdpmulticon argument '%s'", vrdpmulticon);1796 errorArgument("Invalid --vrdpmulticon argument '%s'", vrdpmulticon); 1735 1797 rc = E_FAIL; 1736 1798 break; … … 1739 1801 if (vrdpreusecon) 1740 1802 { 1741 if ( strcmp(vrdpreusecon, "on") == 0)1803 if (!strcmp(vrdpreusecon, "on")) 1742 1804 { 1743 1805 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(true)); 1744 1806 } 1745 else if ( strcmp(vrdpreusecon, "off") == 0)1807 else if (!strcmp(vrdpreusecon, "off")) 1746 1808 { 1747 1809 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(false)); … … 1749 1811 else 1750 1812 { 1751 errorArgument("Invalid - vrdpreusecon argument '%s'", vrdpreusecon);1813 errorArgument("Invalid --vrdpreusecon argument '%s'", vrdpreusecon); 1752 1814 rc = E_FAIL; 1753 1815 break; … … 1785 1847 if (snapshotFolder) 1786 1848 { 1787 if ( strcmp(snapshotFolder, "default") == 0)1849 if (!strcmp(snapshotFolder, "default")) 1788 1850 { 1789 1851 CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(NULL)); … … 1820 1882 if (hdds[i]) 1821 1883 { 1822 if ( strcmp(hdds[i], "none") == 0)1884 if (!strcmp(hdds[i], "none")) 1823 1885 { 1824 1886 machine->DetachHardDisk(Bstr("SATA"), i-4, 0); … … 1884 1946 { 1885 1947 ComPtr<IStorageController> ctl; 1886 if ( fScsiLsiLogic == 0)1948 if (!fScsiLsiLogic) 1887 1949 { 1888 1950 CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic"), StorageBus_SCSI, ctl.asOutParam())); … … 1907 1969 if (hdds[i]) 1908 1970 { 1909 if ( strcmp(hdds[i], "none") == 0)1971 if (!strcmp(hdds[i], "none")) 1910 1972 { 1911 1973 rc = machine->DetachHardDisk(Bstr("LsiLogic"), i-34, 0);
Note:
See TracChangeset
for help on using the changeset viewer.