Pass argc pointer to parse_options()

This lets us keep argc up to date as the backend picks out arguments
from the argv array.
This commit is contained in:
Kristian Høgsberg
2013-02-20 15:27:49 -05:00
parent d5a97ae053
commit 4172f668e7
30 changed files with 53 additions and 54 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ main(int argc, char *argv[])
struct display *display;
struct calibrator *calibrator;
display = display_create(argc, argv);
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
+1 -1
View File
@@ -297,7 +297,7 @@ main(int argc, char *argv[])
struct display *display;
struct clickdot *clickdot;
display = display_create(argc, argv);
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -890,7 +890,7 @@ main(int argc, char *argv[])
if (argc > 1)
return benchmark();
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -1094,7 +1094,7 @@ int main(int argc, char *argv[])
desktop.unlock_task.run = unlock_dialog_finish;
wl_list_init(&desktop.outputs);
desktop.display = display_create(argc, argv);
desktop.display = display_create(&argc, argv);
if (desktop.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -614,7 +614,7 @@ main(int argc, char *argv[])
struct dnd *dnd;
int i;
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -1056,7 +1056,7 @@ main(int argc, char *argv[])
g_type_init();
#endif
editor.display = display_create(argc, argv);
editor.display = display_create(&argc, argv);
if (editor.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+3 -3
View File
@@ -390,11 +390,11 @@ main(int argc, char *argv[])
struct display *d;
struct eventdemo *e;
argc = parse_options(eventdemo_options,
ARRAY_LENGTH(eventdemo_options), argc, argv);
parse_options(eventdemo_options,
ARRAY_LENGTH(eventdemo_options), &argc, argv);
/* Connect to the display and have the arguments parsed */
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
struct display *d;
struct timeval tv;
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -474,7 +474,7 @@ int main(int argc, char *argv[])
{
struct display *d;
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -410,7 +410,7 @@ main(int argc, char *argv[])
int i;
int image_counter = 0;
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -706,7 +706,7 @@ main(int argc, char *argv[])
memset(&virtual_keyboard, 0, sizeof virtual_keyboard);
virtual_keyboard.display = display_create(argc, argv);
virtual_keyboard.display = display_create(&argc, argv);
if (virtual_keyboard.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -281,7 +281,7 @@ main(int argc, char *argv[])
struct display *display;
struct resizor *resizor;
display = display_create(argc, argv);
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -279,7 +279,7 @@ int main(int argc, char *argv[])
struct display *d;
int size;
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -459,7 +459,7 @@ int main(int argc, char *argv[])
char *config_file;
struct output *output;
display = display_create(argc, argv);
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+3 -3
View File
@@ -2683,10 +2683,10 @@ int main(int argc, char *argv[])
NULL);
free(config_file);
argc = parse_options(terminal_options,
ARRAY_LENGTH(terminal_options), argc, argv);
parse_options(terminal_options,
ARRAY_LENGTH(terminal_options), &argc, argv);
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -264,7 +264,7 @@ int main(int argc, char *argv[])
usage(EXIT_FAILURE);
}
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+2 -3
View File
@@ -295,10 +295,9 @@ main(int argc, char *argv[])
g_type_init();
argc = parse_options(view_options,
ARRAY_LENGTH(view_options), argc, argv);
parse_options(view_options, ARRAY_LENGTH(view_options), &argc, argv);
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return -1;
+1 -1
View File
@@ -4329,7 +4329,7 @@ handle_display_data(struct task *task, uint32_t events)
}
struct display *
display_create(int argc, char *argv[])
display_create(int *argc, char *argv[])
{
struct display *d;
+1 -1
View File
@@ -53,7 +53,7 @@ struct rectangle {
};
struct display *
display_create(int argc, char *argv[]);
display_create(int *argc, char *argv[]);
void
display_destroy(struct display *display);
+3 -3
View File
@@ -310,10 +310,10 @@ int main(int argc, char *argv[])
init_frand();
argc = parse_options(wscreensaver_options,
ARRAY_LENGTH(wscreensaver_options), argc, argv);
parse_options(wscreensaver_options,
ARRAY_LENGTH(wscreensaver_options), &argc, argv);
d = display_create(argc, argv);
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
return EXIT_FAILURE;