diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..6253c900 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_out \ No newline at end of file diff --git a/doc/nvidia-settings.desktop b/doc/nvidia-settings.desktop index 252d4fc6..d093b256 100644 --- a/doc/nvidia-settings.desktop +++ b/doc/nvidia-settings.desktop @@ -19,6 +19,10 @@ Comment[ru]=Конфигурирование параметров NVIDIA X Serve Name[ro]=Setări NVIDIA X Server Comment[ro]=Configurează setările NVIDIA X Server +# Translation by Obiwac +Name[nl]=NVIDIA X-Server-Instellingen +Comment[nl]=Configuratie van NVIDIA X-Server-Instellingen + # Translations provided by Sun Microsystems Name[de]=NVIDIA X-Server-Einstellungen Name[es]=Valores de configuración del servidor NVIDIA X diff --git a/src/XF86Config-parser/Util.c b/src/XF86Config-parser/Util.c index c9d1bcd5..072fc181 100644 --- a/src/XF86Config-parser/Util.c +++ b/src/XF86Config-parser/Util.c @@ -7,12 +7,12 @@ * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see . * @@ -31,14 +31,14 @@ void *xconfigAlloc(size_t size) { void *m = malloc(size); - + if (!m) { fprintf(stderr, "memory allocation failure (%s)! \n", strerror(errno)); exit(1); } memset((char *) m, 0, size); return m; - + } /* xconfigAlloc() */ @@ -55,14 +55,14 @@ char *xconfigStrdup(const char *s) if (!s) return NULL; m = strdup(s); - + if (!m) { fprintf(stderr, "memory allocation failure during strdup (%s)! \n", strerror(errno)); exit(1); } return m; - + } /* xconfigStrdup() */ @@ -77,7 +77,7 @@ char *xconfigStrcat(const char *str, ...) va_list args; char *s; char *concat; - + l = 1 + strlen(str); va_start(args, str); s = va_arg(args, char *); @@ -87,10 +87,10 @@ char *xconfigStrcat(const char *str, ...) s = va_arg(args, char *); } va_end(args); - + concat = xconfigAlloc(l); concat[0] = 0; - + strcat(concat, str); va_start(args, str); s = va_arg(args, char *); @@ -99,7 +99,7 @@ char *xconfigStrcat(const char *str, ...) s = va_arg(args, char *); } va_end(args); - + return concat; } /* xconfigStrcat() */ @@ -115,6 +115,7 @@ extern int configLineNo; extern char *configSection; extern char *configPath; +__attribute__((__format__(__printf__, 2, 0))) void xconfigErrorMsg(MsgType t, char *fmt, ...) { va_list ap; @@ -123,7 +124,7 @@ void xconfigErrorMsg(MsgType t, char *fmt, ...) char scratch[64]; b = xconfigAlloc(current_len); - + while (1) { va_start(ap, fmt); len = vsnprintf(b, current_len, fmt, ap); @@ -162,18 +163,18 @@ void xconfigErrorMsg(MsgType t, char *fmt, ...) case DebugMsg: break; case UnknownMsg: break; } - + if (pre) { msg = xconfigStrcat(pre, b, NULL); } else { msg = strdup(b); } - + /* call back into the host to print the message */ xconfigPrint(t, msg); - + free(b); free(msg); if (pre) free(pre); diff --git a/src/gtk+-2.x/ctkappprofile.c b/src/gtk+-2.x/ctkappprofile.c index 77dd5034..b9e6e980 100644 --- a/src/gtk+-2.x/ctkappprofile.c +++ b/src/gtk+-2.x/ctkappprofile.c @@ -2253,7 +2253,7 @@ static void edit_profile_dialog_settings_new_row(GtkTreeView *tree_view, get_default_json_from_type(expected_type)); gtk_list_store_append(GTK_LIST_STORE(tree_model), &iter); - gtk_list_store_set(GTK_LIST_STORE(tree_model), &iter, + gtk_list_store_set(GTK_LIST_STORE(tree_model), &iter, SETTING_LIST_STORE_COL_SETTING, setting, -1); *path = gtk_tree_model_get_path(tree_model, &iter); @@ -2678,6 +2678,7 @@ static void get_profile_dialog_toolbar_items(EditProfileDialog *dialog, *num_dialog_items = ARRAY_LEN(dialog_items); } +__attribute__((__format__(printf, 2, 0))) static void edit_profile_dialog_statusbar_message(EditProfileDialog *dialog, const char *fmt, ...) { diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c index 8a0aa1a0..4563fdfa 100644 --- a/src/gtk+-2.x/ctkframelock.c +++ b/src/gtk+-2.x/ctkframelock.c @@ -66,7 +66,7 @@ #define FRAME_PADDING 5 -enum +enum { ENTRY_DATA_FRAMELOCK = 0, ENTRY_DATA_GPU, @@ -123,7 +123,7 @@ typedef struct _nvFrameLockDataRec nvFrameLockDataRec, *nvFrameLockDataPtr; struct _nvListEntryRec { - + nvListTreePtr tree; GtkWidget *vbox; /* Holds all entry widgets and children */ @@ -419,8 +419,8 @@ static GtkWidget *create_error_msg_dialog(CtkFramelock *ctk_framelock) GtkWidget *image; GtkWidget *alignment; GdkPixbuf *pixbuf; - - + + dialog = gtk_dialog_new_with_buttons("Error", ctk_framelock->parent_window, GTK_DIALOG_MODAL | @@ -445,12 +445,12 @@ static GtkWidget *create_error_msg_dialog(CtkFramelock *ctk_framelock) gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); gtk_container_add(GTK_CONTAINER( ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); - + ctk_framelock->error_msg_label = gtk_label_new(NULL); alignment = gtk_alignment_new(0.0, 0.0, 0, 0); @@ -511,38 +511,38 @@ static GtkWidget *create_sync_state_button(CtkFramelock *ctk_framelock) g_object_ref(G_OBJECT(hbox2)); ctk_framelock->enable_syncing_label = hbox2; - + /* create the disable syncing icon */ - + pixbuf = ctk_widget_render_icon(button, CTK_STOCK_STOP, GTK_ICON_SIZE_BUTTON, "disable frame lock"); if (pixbuf) image = gtk_image_new_from_pixbuf(pixbuf); label = gtk_label_new("Disable Frame Lock"); - + hbox = gtk_hbox_new(FALSE, 2); - + if (image) gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - + hbox2 = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox2), hbox, FALSE, FALSE, 15); gtk_widget_show_all(hbox2); - + /* * XXX increment the reference count, so that when we do * gtk_container_remove() later, it doesn't get destroyed */ g_object_ref(G_OBJECT(hbox2)); - + ctk_framelock->disable_syncing_label = hbox2; - + /* start with syncing disabled */ - + ctk_framelock->selected_syncing_label = ctk_framelock->enable_syncing_label; gtk_container_add(GTK_CONTAINER(button), @@ -592,7 +592,7 @@ static GtkWidget *create_add_devices_dialog(CtkFramelock *ctk_framelock) gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); - + hbox = gtk_hbox_new(FALSE, 12); gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); gtk_container_add(GTK_CONTAINER(ctk_dialog_get_content_area(GTK_DIALOG(dialog))), @@ -606,9 +606,9 @@ static GtkWidget *create_add_devices_dialog(CtkFramelock *ctk_framelock) label = gtk_label_new("X Server:"); descr = gtk_label_new("Please specify the X server to be added to the " "frame lock group."); - + ctk_framelock->add_devices_entry = gtk_entry_new(); - + g_signal_connect(G_OBJECT(ctk_framelock->add_devices_entry), "activate", G_CALLBACK(add_devices_repond_ok), (gpointer) ctk_framelock); @@ -636,7 +636,7 @@ static GtkWidget *create_add_devices_dialog(CtkFramelock *ctk_framelock) gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), ctk_framelock->add_devices_entry, TRUE, TRUE, 0); - + return dialog; } @@ -656,7 +656,7 @@ static GtkWidget *create_remove_devices_dialog(CtkFramelock *ctk_framelock) GtkWidget *image; GdkPixbuf *pixbuf; GtkWidget *alignment; - + dialog = gtk_dialog_new_with_buttons("Remove Device(s)", ctk_framelock->parent_window, @@ -679,19 +679,19 @@ static GtkWidget *create_remove_devices_dialog(CtkFramelock *ctk_framelock) gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); - + hbox = gtk_hbox_new(FALSE, 12); gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); gtk_container_add(GTK_CONTAINER(ctk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox); - + pixbuf = ctk_widget_render_icon(dialog, CTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG, NULL); image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(pixbuf); ctk_framelock->remove_devices_label = gtk_label_new(NULL); - + alignment = gtk_alignment_new(0.0, 0.0, 0, 0); gtk_container_add(GTK_CONTAINER(alignment), image); gtk_box_pack_start(GTK_BOX(hbox), alignment, FALSE, FALSE, 2); @@ -771,7 +771,7 @@ static GtkWidget *my_button_new_with_label(const gchar *txt, GtkWidget *hbox; GtkWidget *vbox; GtkWidget *label; - + btn = gtk_button_new(); hbox = gtk_hbox_new(FALSE, 0); vbox = gtk_vbox_new(FALSE, 0); @@ -799,7 +799,7 @@ static GtkWidget *my_toggle_button_new_with_label(const gchar *txt, GtkWidget *hbox; GtkWidget *vbox; GtkWidget *label; - + btn = gtk_toggle_button_new(); hbox = gtk_hbox_new(FALSE, 0); vbox = gtk_vbox_new(FALSE, 0); @@ -942,7 +942,7 @@ static char *get_framelock_name(nvFrameLockDataPtr data, gboolean simple) snprintf(tmp, 32, " (%s %d)", data->board_name, NvCtrlGetTargetId(ctrl_target)); - + name = g_strconcat(server_name?server_name:"Unknown X Server", tmp, NULL); return name; @@ -1017,17 +1017,19 @@ static void update_entry_label(CtkFramelock *ctk_framelock, * Displays an error message dialog using the error message dialog. * */ + +__attribute__((__format__(__printf__, 2, 0))) static void error_msg(CtkFramelock *ctk_framelock, const gchar *fmt, ...) { gchar *msg; NV_VSNPRINTF(msg, fmt); - + gtk_label_set_line_wrap(GTK_LABEL(ctk_framelock->error_msg_label), TRUE); gtk_label_set_use_markup(GTK_LABEL(ctk_framelock->error_msg_label), TRUE); gtk_label_set_markup(GTK_LABEL(ctk_framelock->error_msg_label), msg); gtk_widget_show_all(ctk_framelock->error_msg_dialog); - + free(msg); } @@ -1194,11 +1196,11 @@ static void list_entry_update_framelock_controls(CtkFramelock *ctk_framelock, } else { gtk_widget_hide(data->extra_info_hbox); } - + /* Activate Sync Rate when frame lock is enabled */ gtk_widget_set_sensitive(data->rate_label, framelock_enabled); gtk_widget_set_sensitive(data->rate_text, framelock_enabled); - + /* Activate Sync Delay when frame lock is enabled */ gtk_widget_set_sensitive(data->delay_label, framelock_enabled); gtk_widget_set_sensitive(data->delay_text, framelock_enabled); @@ -1619,7 +1621,7 @@ static void list_entry_set_select(nvListEntryPtr entry, gint selected) /* Update the state of the entry's widgets */ - + select_widget(entry->ebox, state); if (!entry->data) { @@ -1687,12 +1689,12 @@ static void expander_button_clicked(GtkWidget *widget, gpointer user_data) ctk_image_new_from_str(CTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_size_request(entry->expander_button, 20, 20); - + gtk_container_add(GTK_CONTAINER(entry->expander_button), entry->expander_button_image); gtk_widget_show_all(entry->expander_button); gtk_widget_hide(entry->child_vbox); - + } else { /* Expand */ gtk_container_remove(GTK_CONTAINER(entry->expander_button), @@ -1727,19 +1729,19 @@ static void list_entry_add_expander_button(nvListEntryPtr entry) if (!entry || entry->expander_button) { return; } - + entry->expander_vbox = gtk_vbox_new(FALSE, 0); entry->expander_button = gtk_button_new(); entry->expander_button_image = ctk_image_new_from_str(CTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_widget_set_size_request(entry->expander_button, 20, 20); + gtk_widget_set_size_request(entry->expander_button, 20, 20); entry->expanded = True; - + g_signal_connect(G_OBJECT(entry->expander_button), "clicked", G_CALLBACK(expander_button_clicked), (gpointer) entry); - + gtk_container_add(GTK_CONTAINER(entry->expander_button), entry->expander_button_image); gtk_box_pack_start(GTK_BOX(entry->expander_vbox), entry->expander_button, @@ -1871,7 +1873,7 @@ static void list_entry_add_child(nvListEntryPtr parent, nvListEntryPtr child) } /* Add the child into the parent's child list */ - + child->parent = parent; child->tree = parent->tree; if (!parent->children) { @@ -1929,7 +1931,7 @@ static void list_entry_associate(nvListEntryPtr entry, nvListTreePtr tree) if (!entry) { return; } - + /* Remove references to the entry from the old tree */ if (entry->tree && (entry->tree != tree)) { @@ -1970,7 +1972,7 @@ static void list_entry_unparent(nvListEntryPtr child) nvListEntryPtr entry; nvListEntryPtr prev; nvListEntryPtr parent; - + if (!child || !child->parent) { return; } @@ -2346,7 +2348,7 @@ static void list_tree_remove_entry(nvListTreePtr tree, nvListEntryPtr entry) * This is not a top-level entry so just * remove it from its parent */ - + list_entry_unparent(entry); } else { @@ -2373,7 +2375,7 @@ static void list_tree_remove_entry(nvListTreePtr tree, nvListEntryPtr entry) tree->nentries--; list_entry_associate(entry, NULL); - + gtk_container_remove(GTK_CONTAINER(tree->vbox), entry->vbox); } @@ -2491,13 +2493,13 @@ static nvListEntryPtr find_server_by_name(nvListTreePtr tree, name = NULL; break; } - + if (name && !strcasecmp(server_name, name)){ free(name); return entry; } free(name); - + entry = entry->next_sibling; } @@ -2525,7 +2527,7 @@ static nvListEntryPtr find_server_by_id(nvListTreePtr tree, return entry; } - + entry = entry->next_sibling; } @@ -2620,12 +2622,12 @@ static void toggle_extra_info(GtkWidget *widget, gpointer data) { CtkFramelock *ctk_framelock = CTK_FRAMELOCK(data); gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - + gtk_button_set_label(GTK_BUTTON(widget), enabled?"Hide Extra Info":"Show Extra Info"); update_framelock_controls(ctk_framelock); - + update_framelock_status(ctk_framelock); ctk_config_statusbar_message(ctk_framelock->ctk_config, @@ -3047,7 +3049,7 @@ static gboolean do_enable_confirm_countdown(gpointer *user_data) * */ static Bool confirm_serverless_framelock(CtkFramelock *ctk_framelock) -{ +{ gint result; @@ -3117,7 +3119,7 @@ static void toggle_sync_enable(GtkWidget *button, gpointer data) framelock_enabled = (framelock_enabled || something_enabled); } - /* + /* * toggle the TEST_SIGNAL, to guarantee accuracy of the universal * frame count (as returned by the glXQueryFrameCountNV() function * in the GLX_NV_swap_group extension) @@ -3174,45 +3176,45 @@ static void toggle_sync_enable(GtkWidget *button, gpointer data) * This function is called once the test signal has finished. * */ -static gint test_link_done(gpointer data) +static gint test_link_done(gpointer data) { CtkFramelock *ctk_framelock; nvListEntryPtr entry; ctk_framelock = CTK_FRAMELOCK(data); - + entry = get_gpu_server_entry((nvListTreePtr)ctk_framelock->tree); if (!entry) return FALSE; - + /* Test signal already disabled? */ if (!ctk_framelock->test_link_enabled) return FALSE; - + /* Disable the test signal */ - + ctk_framelock->test_link_enabled = FALSE; NvCtrlSetAttribute(((nvGPUDataPtr)(entry->data))->ctrl_target, NV_CTRL_FRAMELOCK_TEST_SIGNAL, NV_CTRL_FRAMELOCK_TEST_SIGNAL_DISABLE); - + gtk_grab_remove(ctk_framelock->test_link_button); - + gdk_window_set_cursor(ctk_widget_get_window( GTK_WIDGET(ctk_framelock->parent_window)), NULL); /* un-press the test link button */ - + g_signal_handlers_block_by_func (G_OBJECT(ctk_framelock->test_link_button), G_CALLBACK(toggle_test_link), (gpointer) ctk_framelock); - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(ctk_framelock->test_link_button), FALSE); - + g_signal_handlers_unblock_by_func (G_OBJECT(ctk_framelock->test_link_button), G_CALLBACK(toggle_test_link), @@ -3243,7 +3245,7 @@ static void toggle_test_link(GtkWidget *button, gpointer data) if (!ctk_framelock->framelock_enabled) goto fail; /* User cancels the test signal */ - + if (ctk_framelock->test_link_enabled) { test_link_done(ctk_framelock); return; @@ -3262,19 +3264,19 @@ static void toggle_test_link(GtkWidget *button, gpointer data) } /* enable the test signal */ - + ctk_framelock->test_link_enabled = TRUE; gdk_window_set_cursor (ctk_widget_get_window(GTK_WIDGET(ctk_framelock->parent_window)), ctk_framelock->wait_cursor); - + gtk_grab_add(button); - + NvCtrlSetAttribute(((nvGPUDataPtr)(entry->data))->ctrl_target, NV_CTRL_FRAMELOCK_TEST_SIGNAL, NV_CTRL_FRAMELOCK_TEST_SIGNAL_ENABLE); - + ctk_config_statusbar_message(ctk_framelock->ctk_config, "Test link started."); @@ -3284,7 +3286,7 @@ static void toggle_test_link(GtkWidget *button, gpointer data) test_link_done, (gpointer) ctk_framelock); return; - + fail: /* Reset the button */ @@ -3294,12 +3296,12 @@ static void toggle_test_link(GtkWidget *button, gpointer data) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(ctk_framelock->test_link_button), enabled); - + g_signal_handlers_unblock_by_func (G_OBJECT(ctk_framelock->test_link_button), G_CALLBACK(toggle_test_link), (gpointer) ctk_framelock); -} +} @@ -3448,12 +3450,12 @@ static gboolean detect_video_mode_timer(gpointer user_data) ctk_framelock->current_detect_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL; break; - + case NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL: ctk_framelock->current_detect_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL; break; - + case NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL: ctk_framelock->current_detect_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL; @@ -3467,7 +3469,7 @@ static gboolean detect_video_mode_timer(gpointer user_data) goto done; break; } - + /* * Set the new video format */ @@ -3488,7 +3490,7 @@ static gboolean detect_video_mode_timer(gpointer user_data) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(ctk_framelock->video_mode_detect), FALSE); - + g_signal_handlers_unblock_by_func (G_OBJECT(ctk_framelock->video_mode_detect), G_CALLBACK(toggle_detect_video_mode), @@ -3537,7 +3539,7 @@ static void toggle_detect_video_mode(GtkToggleButton *button, if (!entry) return; data = (nvFrameLockDataPtr)(entry->data); - + ctk_framelock->current_detect_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_AUTO; @@ -3546,7 +3548,7 @@ static void toggle_detect_video_mode(GtkToggleButton *button, ctk_framelock->video_mode_detect_timer = g_timeout_add(500, detect_video_mode_timer, user_data); - + ctk_config_statusbar_message(ctk_framelock->ctk_config, "Attempting to detect house sync..."); } @@ -3573,8 +3575,8 @@ static void list_entry_update_framelock_status(CtkFramelock *ctk_framelock, gboolean framelock_enabled; gboolean is_server; ReturnStatus ret; - - + + NvCtrlGetAttribute(ctrl_target, NV_CTRL_FRAMELOCK_SYNC_DELAY, &delay); NvCtrlGetAttribute(ctrl_target, NV_CTRL_FRAMELOCK_HOUSE_STATUS, &house); NvCtrlGetAttribute(ctrl_target, NV_CTRL_FRAMELOCK_PORT0_STATUS, &port0); @@ -3617,7 +3619,7 @@ static void list_entry_update_framelock_status(CtkFramelock *ctk_framelock, snprintf(str, 32, "%d.%.3d Hz", (rate / 1000), (rate % 1000)); } gtk_label_set_text(GTK_LABEL(data->rate_text), str); - + /* Sync Delay (Skew) */ gtk_widget_set_sensitive(data->delay_label, framelock_enabled); gtk_widget_set_sensitive(data->delay_text, framelock_enabled); @@ -3639,7 +3641,7 @@ static void list_entry_update_framelock_status(CtkFramelock *ctk_framelock, snprintf(str, 32, "Unknown"); } gtk_label_set_text(GTK_LABEL(data->house_sync_rate_text), str); - + /* House Sync and Ports are always active */ update_image(data->house_hbox, (house ? ctk_framelock->led_green_pixbuf : @@ -3873,7 +3875,7 @@ static gboolean check_for_ethernet(gpointer user_data) static gboolean first_error = TRUE; nvListEntryPtr entry; nvFrameLockDataPtr error_data = NULL; - + /* Look through the framelock entries and check the * Ethernet status on each one @@ -4651,7 +4653,7 @@ GType ctk_framelock_get_type( NULL, /* instance_init */ NULL /* value_table */ }; - + ctk_framelock_type = g_type_register_static (GTK_TYPE_VBOX, "CtkFramelock", &ctk_framelock_info, 0); } @@ -4847,7 +4849,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, ctk_config_set_tooltip(ctk_config, button, __test_link_button_help); ctk_framelock->test_link_button = button; - + button = create_sync_state_button(ctk_framelock); gtk_widget_set_sensitive(button, FALSE); @@ -4859,7 +4861,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, /* Create combo boxes */ - /* Select video mode widget dropdown/label depending on + /* Select video mode widget dropdown/label depending on * video mode is read-only. */ ret = NvCtrlGetValidAttributeValues(ctrl_target, @@ -4888,7 +4890,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, ctk_framelock->video_mode_widget = combo_box; } else { ctk_framelock->video_mode_widget = gtk_label_new("None"); - } + } ctk_config_set_tooltip(ctk_config, ctk_framelock->video_mode_widget, __video_mode_help); @@ -4970,13 +4972,13 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, gtk_box_pack_start(GTK_BOX(ctk_framelock), banner, FALSE, FALSE, 0); /* Quadro Sync Frame */ - + frame = gtk_frame_new(NULL); gtk_frame_set_label(GTK_FRAME(frame), "Quadro Sync Devices"); gtk_box_pack_start(GTK_BOX(ctk_framelock), frame, TRUE, TRUE, 0); /* scrollable window */ - + sw = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -4985,9 +4987,9 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, gtk_container_set_border_width(GTK_CONTAINER(padding), FRAME_PADDING); gtk_container_add(GTK_CONTAINER(padding), sw); gtk_container_add(GTK_CONTAINER(frame), padding); - + /* create a viewport so we can have a white background */ - + vp = gtk_viewport_new(NULL, NULL); select_widget(vp, GTK_STATE_NORMAL); gtk_container_add(GTK_CONTAINER(sw), GTK_WIDGET(vp)); @@ -4996,7 +4998,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, /* add the custom tree & buttons */ vbox = ((nvListTreePtr)(ctk_framelock->tree))->vbox; - + gtk_container_set_border_width(GTK_CONTAINER(vbox), FRAME_PADDING); gtk_container_add(GTK_CONTAINER(vp), vbox); @@ -5021,7 +5023,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, ctk_framelock->house_sync_frame = frame; gtk_frame_set_label(GTK_FRAME(frame), "House Sync"); gtk_box_pack_start(GTK_BOX(ctk_framelock), frame, FALSE, FALSE, 0); - + padding = gtk_hbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(padding), FRAME_PADDING); gtk_container_add(GTK_CONTAINER(frame), padding); @@ -5117,7 +5119,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, label = gtk_label_new("Sync Edge:"); ctk_framelock->sync_edge_frame = frame2; - + gtk_box_pack_start(GTK_BOX(padding), frame2, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(frame2), hbox); @@ -5133,7 +5135,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, label = gtk_label_new("Video Mode:"); ctk_framelock->video_mode_frame = frame2; - + gtk_box_pack_start(GTK_BOX(padding), frame2, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(frame2), hbox); @@ -5152,7 +5154,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(hbox), ctk_framelock->test_link_button, FALSE, FALSE, 0); - + gtk_box_pack_start(GTK_BOX(ctk_framelock), hbox, FALSE, FALSE, 0); /* show everything */ @@ -5192,7 +5194,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target, g_free(string); return GTK_WIDGET(object); - + } /* ctk_framelock_new() */ @@ -5231,17 +5233,17 @@ static void add_devices_response(GtkWidget *button, gint response, const gchar *display_name; /* hide the dialog box */ - + gtk_widget_hide(ctk_framelock->add_devices_dialog); - + /* set the focus back to the text entry */ - + gtk_widget_grab_focus(ctk_framelock->add_devices_entry); - + /* if the response is not "OK" then we're done */ - + if (response != GTK_RESPONSE_OK) return; - + /* get the display name specified by the user */ display_name = @@ -5257,11 +5259,11 @@ static void add_devices_response(GtkWidget *button, gint response, } /* Update frame lock controls */ - + update_framelock_controls(ctk_framelock); /* Update frame lock status */ - + update_framelock_status(ctk_framelock); /* Update status bar */ @@ -5672,7 +5674,7 @@ static void add_framelock_devices(CtkFramelock *ctk_framelock, /* Create the frame lock widgets */ framelock_data->label = gtk_label_new(""); - + framelock_data->receiving_label = gtk_label_new("Receiving"); framelock_data->receiving_hbox = gtk_hbox_new(FALSE, 0); @@ -5684,7 +5686,7 @@ static void add_framelock_devices(CtkFramelock *ctk_framelock, framelock_data->house_label = gtk_label_new("House"); framelock_data->house_hbox = gtk_hbox_new(FALSE, 0); - + framelock_data->house_sync_rate_label = gtk_label_new("House Sync Rate:"); framelock_data->house_sync_rate_text = gtk_label_new(""); @@ -5794,7 +5796,7 @@ static void add_devices(CtkFramelock *ctk_framelock, /* Assume sever id 0 if none given */ sprintf(server_name + strlen(server_name), ":0"); } - + /* Connect to the corresponding CtrlSystem */ systems = ctk_framelock->ctrl_target->system->system_list; @@ -5812,7 +5814,7 @@ static void add_devices(CtkFramelock *ctk_framelock, } goto done; } - + /* Get a control target to make queries about the system */ ctrl_target = NvCtrlGetDefaultTarget(system); @@ -5828,7 +5830,7 @@ static void add_devices(CtkFramelock *ctk_framelock, } goto done; } - + /* Try to prevent users from adding the same X server more than once */ if (get_server_id(ctrl_target, &server_id) && @@ -6034,7 +6036,7 @@ void ctk_framelock_config_file_attributes(GtkWidget *w, if (ctk_framelock->warn_dialog) { return; } - + /* Add attributes from all the list entries */ add_entries_to_parsed_attributes (((nvListTreePtr)(ctk_framelock->tree))->entries, head); @@ -6101,7 +6103,7 @@ GtkTextBuffer *ctk_framelock_create_help(GtkTextTagTable *table) GtkTextBuffer *b; b = gtk_text_buffer_new(table); - + gtk_text_buffer_get_iter_at_offset(b, &i, 0); ctk_help_title(b, &i, "Frame Lock Help"); @@ -6169,7 +6171,7 @@ GtkTextBuffer *ctk_framelock_create_help(GtkTextTagTable *table) ctk_help_para(b, &i, "If the X Server is remote, be sure you have " "configured remote access (via `xhost`, for example) " "such that you are allowed to establish a connection."); - + ctk_help_heading(b, &i, "Removing Devices"); ctk_help_para(b, &i, "%s", __remove_devices_button_help); @@ -6211,7 +6213,7 @@ GtkTextBuffer *ctk_framelock_create_help(GtkTextTagTable *table) ctk_help_para(b, &i, "%s", __detect_video_mode_button_help); /* Button Help */ - + ctk_help_heading(b, &i, "Test Link"); ctk_help_para(b, &i, "Use this toggle button to enable testing of " "the cabling between all members of the frame lock group. " diff --git a/src/gtk+-2.x/ctkgauge.c b/src/gtk+-2.x/ctkgauge.c index 36e6a970..63ef9088 100644 --- a/src/gtk+-2.x/ctkgauge.c +++ b/src/gtk+-2.x/ctkgauge.c @@ -416,7 +416,7 @@ static void draw(CtkGauge *ctk_gauge) y += 2 * 2; } - for (i = i; i > 0; i--) { + for (; i > 0; i--) { #ifdef CTK_GTK3 set_foreground_color(ctk_gauge->c_context, i); cairo_rectangle(ctk_gauge->c_context, x1, y, width, 2); diff --git a/src/gtk+-2.x/ctkserver.c b/src/gtk+-2.x/ctkserver.c index 1de17d4c..57237646 100644 --- a/src/gtk+-2.x/ctkserver.c +++ b/src/gtk+-2.x/ctkserver.c @@ -65,10 +65,10 @@ GType ctk_server_get_type(void) * Copyright Information for xdpyinfo: * *********************************************************************** - * + * * xdpyinfo - print information about X display connection * - * + * Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -175,7 +175,7 @@ static gchar * get_server_vendor_version(CtrlTarget *ctrl_target) (vendrel / 100000) % 100, (vendrel / 1000) % 100); if (vendrel % 1000) { - version = g_strdup_printf("%s.%d", tmp, vendrel % 1000); + version = g_strdup_printf("%s.%d", tmp, vendrel % 1000); } else { version = g_strdup(tmp); } @@ -217,7 +217,7 @@ static gchar * get_server_vendor_version(CtrlTarget *ctrl_target) } /* Add the vendor release number */ - + if (version) { tmp = g_strdup_printf("%s (%d)", version, vendrel); } else { @@ -263,7 +263,7 @@ GtkWidget* ctk_server_new(CtrlTarget *ctrl_target, gchar *num_screens = NULL; ReturnStatus ret; - int tmp, os_val; + int tmp, os_val = NV_CTRL_OPERATING_SYSTEM_GENERIC; int xinerama_enabled; int row; @@ -464,12 +464,12 @@ GtkWidget* ctk_server_new(CtrlTarget *ctrl_target, /* print special trademark text for FreeBSD */ - + if (os_val == NV_CTRL_OPERATING_SYSTEM_FREEBSD) { hseparator = gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(vbox), hseparator, FALSE, FALSE, 0); - + label = gtk_label_new(NULL); gtk_label_set_markup(GTK_LABEL(label), @@ -486,13 +486,13 @@ GtkWidget* ctk_server_new(CtrlTarget *ctrl_target, "Foundation." "\n" ""); - + gtk_label_set_selectable(GTK_LABEL(label), TRUE); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - + hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); } @@ -523,9 +523,9 @@ GtkTextBuffer *ctk_server_create_help(GtkTextTagTable *table, { GtkTextIter i; GtkTextBuffer *b; - + b = gtk_text_buffer_new(table); - + gtk_text_buffer_get_iter_at_offset(b, &i, 0); ctk_help_title(b, &i, "System Information Help"); @@ -536,7 +536,7 @@ GtkTextBuffer *ctk_server_create_help(GtkTextTagTable *table, "'Linux', 'FreeBSD', and 'SunOS'. This also specifies the " "platform on which the operating system is running, such " "as x86, x86_64, or ia64."); - + ctk_help_heading(b, &i, "NVIDIA Driver Version"); ctk_help_para(b, &i, "This is the version of the NVIDIA Accelerated " "Graphics Driver currently in use."); diff --git a/src/gtk+-2.x/ctkslimm.c b/src/gtk+-2.x/ctkslimm.c index 84642580..6793c283 100644 --- a/src/gtk+-2.x/ctkslimm.c +++ b/src/gtk+-2.x/ctkslimm.c @@ -50,7 +50,7 @@ static nvDisplayPtr find_active_display(nvLayoutPtr layout); static nvDisplayPtr intersect_modelines_list(CtkMMDialog *ctk_mmdialog, nvLayoutPtr layout); static void remove_duplicate_modelines_from_list(CtkMMDialog *ctk_mmdialog); -static Bool other_displays_have_modeline(nvLayoutPtr layout, +static Bool other_displays_have_modeline(nvLayoutPtr layout, nvDisplayPtr display, nvModeLinePtr modeline); @@ -116,9 +116,9 @@ static Bool compute_screen_size(CtkMMDialog *ctk_object, gint *width, v_overlap = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ctk_object->spbtn_vedge_overlap)); /* Total X Screen Size Calculation */ - *width = x_displays * ctk_object->cur_modeline->data.hdisplay - + *width = x_displays * ctk_object->cur_modeline->data.hdisplay - (x_displays - 1) * h_overlap; - *height = y_displays * ctk_object->cur_modeline->data.vdisplay - + *height = y_displays * ctk_object->cur_modeline->data.vdisplay - (y_displays - 1) * v_overlap; return TRUE; @@ -161,7 +161,7 @@ static void validate_screen_size(CtkMMDialog *ctk_object) GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "%s", err_msg); - + gtk_dialog_run(GTK_DIALOG(dlg)); gtk_widget_destroy(dlg); g_free(err_msg); @@ -320,7 +320,7 @@ static void setup_display_refresh_dropdown(CtkMMDialog *ctk_object) /* Generate the refresh dropdown */ menu = CTK_DROP_DOWN_MENU(ctk_object->mnu_display_refresh); - + g_signal_handlers_block_by_func (G_OBJECT(ctk_object->mnu_display_refresh), G_CALLBACK(display_refresh_changed), (gpointer) ctk_object); @@ -395,7 +395,7 @@ static void setup_display_refresh_dropdown(CtkMMDialog *ctk_object) } /* Add "DoubleScan" and "Interlace" information */ - + if (modeline->data.flags & V_DBLSCAN) { extra = g_strdup_printf("DoubleScan"); } @@ -416,7 +416,7 @@ static void setup_display_refresh_dropdown(CtkMMDialog *ctk_object) g_free(name); name = tmp; } - + /* Keep track of the selected modeline */ if (ctk_object->cur_modeline == modeline) { @@ -434,9 +434,9 @@ static void setup_display_refresh_dropdown(CtkMMDialog *ctk_object) float rate = modeline->refresh_rate; /* Found better resolution */ - if (ctk_object->refresh_table[cur_idx]->data.hdisplay != + if (ctk_object->refresh_table[cur_idx]->data.hdisplay != ctk_object->cur_modeline->data.hdisplay || - ctk_object->refresh_table[cur_idx]->data.vdisplay != + ctk_object->refresh_table[cur_idx]->data.vdisplay != ctk_object->cur_modeline->data.vdisplay) { cur_idx = ctk_object->refresh_table_len; } @@ -639,7 +639,7 @@ static Bool parse_slimm_layout(CtkMMDialog *ctk_mmdialog, int i; int found; nvModeLinePtr *cur_modeline; // Used to assign the current modeline - + nvDisplayPtr display = find_active_display(layout); if (display == NULL) { err_msg = "Active display not found."; @@ -748,7 +748,7 @@ static Bool parse_slimm_layout(CtkMMDialog *ctk_mmdialog, &(locs[num_locs].y)); num_locs++; } - + /* Parse next mode */ mode_str = strtok(NULL, ","); } @@ -1162,7 +1162,7 @@ static nvDisplayPtr setup_display(CtkMMDialog *ctk_mmdialog) free(ctk_mmdialog); return NULL; - } else if ((ctk_mmdialog->modelines == NULL)) { + } else if (ctk_mmdialog->modelines == NULL) { /* The modepool for the active display did not have any modes in * its modepool matching any of the modes on the modepool of any * other display in the layout, causing intersect_modelines to @@ -1498,7 +1498,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new("Refresh Rate"); @@ -1507,7 +1507,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); /* Option menu for resolutions */ @@ -1519,10 +1519,10 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, setup_display_resolution_dropdown(ctk_mmdialog); label = gtk_label_new(""); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_box_pack_end(GTK_BOX(hbox), ctk_mmdialog->mnu_display_resolution, + gtk_box_pack_end(GTK_BOX(hbox), ctk_mmdialog->mnu_display_resolution, TRUE, TRUE, 0); gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); g_signal_connect(G_OBJECT(ctk_mmdialog->mnu_display_resolution), "changed", G_CALLBACK(display_resolution_changed), (gpointer) ctk_mmdialog); @@ -1542,7 +1542,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_end(GTK_BOX(hbox), ctk_mmdialog->mnu_display_refresh, TRUE, TRUE, 0); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); /* Edge Overlap section */ hbox = gtk_hbox_new(FALSE, 0); @@ -1553,7 +1553,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 8, 9, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new("Total Size"); @@ -1562,7 +1562,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); hbox = gtk_hbox_new(FALSE, 0); @@ -1588,15 +1588,15 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 9, 10, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new("Vertical: "); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10); - spinbutton = gtk_spin_button_new_with_range(-ctk_mmdialog->cur_modeline->data.vdisplay, - ctk_mmdialog->cur_modeline->data.vdisplay, + spinbutton = gtk_spin_button_new_with_range(-ctk_mmdialog->cur_modeline->data.vdisplay, + ctk_mmdialog->cur_modeline->data.vdisplay, 1); ctk_mmdialog->spbtn_vedge_overlap = spinbutton; gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbutton), @@ -1612,7 +1612,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 0, 1, 10, 11, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); label = gtk_label_new("NULL"); ctk_mmdialog->lbl_total_size = label; @@ -1622,7 +1622,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, ctk_mmdialog->box_total_size = hbox; gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new("Maximum Size"); @@ -1631,7 +1631,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); tmp = g_strdup_printf("%dx%d", ctk_mmdialog->max_screen_width, ctk_mmdialog->max_screen_height); @@ -1640,7 +1640,7 @@ CtkMMDialog *create_mosaic_dialog(GtkWidget *parent, hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10); gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 11, 12, GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, 0.5, 0.5); + GTK_EXPAND | GTK_FILL, 0, 0); /* If current SLI Mode != Mosaic, disable UI elements initially */ @@ -1667,18 +1667,18 @@ void ctk_mmdialog_insert_help(GtkTextBuffer *b, GtkTextIter *i) ctk_help_para(b, i, "This dialog allows easy configuration " "of SLI Mosaic Mode."); - + ctk_help_heading(b, i, "Display Configuration"); ctk_help_para(b, i, "This drop down menu allows selection of the display grid " "configuration for SLI Mosaic Mode; the possible configurations " "are described as rows x columns."); - + ctk_help_heading(b, i, "Resolution"); ctk_help_para(b, i, "This drop down menu allows selection of the resolution to " "use for each of the displays in SLI Mosaic Mode. Note that only " "the resolutions that are available for each display will be " "shown here."); - + ctk_help_heading(b, i, "Refresh Rate"); ctk_help_para(b, i, "This drop down menu allows selection of the refresh rate " "to use for each of the displays in SLI Mosaic Mode. By default " diff --git a/src/jansson/error.c b/src/jansson/error.c index 310af881..0b5dc22e 100644 --- a/src/jansson/error.c +++ b/src/jansson/error.c @@ -44,6 +44,7 @@ void jsonp_error_set(json_error_t *error, int line, int column, va_end(ap); } +__attribute__((__format__(__printf__, 6, 0))) void jsonp_error_vset(json_error_t *error, int line, int column, size_t position, enum json_error_code code, const char *msg, va_list ap) diff --git a/src/jansson/load.c b/src/jansson/load.c index 8700919f..0d7ff101 100644 --- a/src/jansson/load.c +++ b/src/jansson/load.c @@ -83,6 +83,7 @@ typedef struct { /*** error reporting ***/ +__attribute__((__format__(__printf__, 4, 0))) static void error_set(json_error_t *error, const lex_t *lex, enum json_error_code code, const char *msg, ...) diff --git a/src/libXNVCtrl/NVCtrl.c b/src/libXNVCtrl/NVCtrl.c index a18c8154..19dd5717 100644 --- a/src/libXNVCtrl/NVCtrl.c +++ b/src/libXNVCtrl/NVCtrl.c @@ -25,8 +25,11 @@ * Make sure that XTHREADS is defined, so that the * LockDisplay/UnlockDisplay macros are expanded properly and the * libXNVCtrl library properly protects the Display connection. + * Include XlibConf.h first so as to not redefine XTHREADS. */ +#include + #if !defined(XTHREADS) #define XTHREADS #endif /* XTHREADS */ @@ -327,7 +330,7 @@ Bool XNVCTRLSetTargetAttributeAndGetStatus ( } UnlockDisplay (dpy); SyncHandle (); - + success = rep.flags; return success; } @@ -570,7 +573,7 @@ static Bool XNVCTRLQueryValidTargetAttributeValues32 ( int target_type, int target_id, unsigned int display_mask, - unsigned int attribute, + unsigned int attribute, NVCTRLAttributeValidValuesRec *values ){ xnvCtrlQueryValidAttributeValuesReply rep; @@ -1183,7 +1186,7 @@ static Bool wire_to_event (Display *dpy, XEvent *host, xEvent *wire) XNVCtrlBinaryEventTarget *reTargetBinary; XNVCTRLCheckExtension (dpy, info, False); - + switch ((wire->u.u.type & 0x7F) - info->codes->first_event) { case ATTRIBUTE_CHANGED_EVENT: re = (XNVCtrlEvent *) host; diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h index df888cf1..d52825a5 100644 --- a/src/libXNVCtrl/NVCtrl.h +++ b/src/libXNVCtrl/NVCtrl.h @@ -124,7 +124,7 @@ * * Integer attributes can be queried through the XNVCTRLQueryAttribute() and * XNVCTRLQueryTargetAttribute() function calls. - * + * * Integer attributes can be set through the XNVCTRLSetAttribute() and * XNVCTRLSetTargetAttribute() function calls. * @@ -207,7 +207,7 @@ */ #define NV_CTRL_TOTAL_GPU_MEMORY 6 /* R--G */ -#define NV_CTRL_VIDEO_RAM NV_CTRL_TOTAL_GPU_MEMORY +#define NV_CTRL_VIDEO_RAM NV_CTRL_TOTAL_GPU_MEMORY /* @@ -229,6 +229,7 @@ #define NV_CTRL_OPERATING_SYSTEM_LINUX 0 #define NV_CTRL_OPERATING_SYSTEM_FREEBSD 1 #define NV_CTRL_OPERATING_SYSTEM_SUNOS 2 +#define NV_CTRL_OPERATING_SYSTEM_GENERIC 3 /* @@ -256,7 +257,7 @@ /* * NV_CTRL_FSAA_MODE - the FSAA setting for OpenGL clients; possible * FSAA modes: - * + * * NV_CTRL_FSAA_MODE_2x "2x Bilinear Multisampling" * NV_CTRL_FSAA_MODE_2x_5t "2x Quincunx Multisampling" * NV_CTRL_FSAA_MODE_15x15 "1.5 x 1.5 Supersampling" @@ -431,7 +432,7 @@ /* * NV_CTRL_FRAMELOCK_SYNC_DELAY - delay between the frame lock pulse - * and the GPU sync. This value must be multiplied by + * and the GPU sync. This value must be multiplied by * NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION to determine the sync delay in * nanoseconds. * @@ -444,7 +445,7 @@ * The Sync Delay _MAX and _FACTOR are different for different * Quadro Sync products and so, to be correct, the valid values for * NV_CTRL_FRAMELOCK_SYNC_DELAY must be queried to get the range - * of acceptable sync delay values, and + * of acceptable sync delay values, and * NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION must be queried to * obtain the correct factor. */ @@ -851,13 +852,13 @@ /* * NV_CTRL_PBUFFER_SCANOUT_SUPPORTED - returns whether this X screen * supports scanout of FP pbuffers; - * + * * if this screen does not support PBUFFER_SCANOUT, then all other * PBUFFER_SCANOUT attributes are unavailable. * * PBUFFER_SCANOUT is supported if and only if: - * - Twinview is configured with clone mode. The secondary screen is used to - * scanout the pbuffer. + * - Twinview is configured with clone mode. The secondary screen is used to + * scanout the pbuffer. * - The desktop is running in with 16 bits per pixel. */ #define NV_CTRL_PBUFFER_SCANOUT_SUPPORTED 65 /* not supported */ @@ -883,11 +884,11 @@ * - specify NV_CTRL_GVO_SYNC_MODE (one of FREE_RUNNING, GENLOCK, or * FRAMELOCK); if you specify GENLOCK or FRAMELOCK, you should also * specify NV_CTRL_GVO_SYNC_SOURCE. - * + * * - Use NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED and * NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED to detect what input syncs are * present. - * + * * (If no analog sync is detected but it is known that a valid * bi-level or tri-level sync is connected set * NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE appropriately and @@ -1026,11 +1027,11 @@ #define NV_CTRL_GVIO_VIDEO_FORMAT_720P_50_00_SMPTE296 16 #define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_SMPTE274 17 #define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_SMPTE274 18 -#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_30_00_SMPTE296 19 -#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_29_97_SMPTE296 20 -#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_25_00_SMPTE296 21 -#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_24_00_SMPTE296 22 -#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_23_98_SMPTE296 23 +#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_30_00_SMPTE296 19 +#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_29_97_SMPTE296 20 +#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_25_00_SMPTE296 21 +#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_24_00_SMPTE296 22 +#define NV_CTRL_GVIO_VIDEO_FORMAT_720P_23_98_SMPTE296 23 #define NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_25_00_SMPTE274 24 #define NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_29_97_SMPTE274 25 #define NV_CTRL_GVIO_VIDEO_FORMAT_1080PSF_30_00_SMPTE274 26 @@ -1311,7 +1312,7 @@ * the video format specified in the display_mask field; eg: * * XNVCTRLQueryAttribute (dpy, - * screen, + * screen, * NV_CTRL_GVIO_VIDEO_FORMAT_487I_59_94_SMPTE259_NTSC, * NV_CTRL_GVIO_VIDEO_FORMAT_WIDTH, * &value); @@ -2329,7 +2330,7 @@ #define NV_CTRL_GVI_NUM_JACKS 307 /* R--I */ -/* +/* * NV_CTRL_GVI_MAX_LINKS_PER_STREAM - Returns the maximum supported number of * links that can be tied to one stream. */ @@ -2483,28 +2484,28 @@ #define NV_CTRL_THERMAL_COOLER_LEVEL 320 /* RW-C */ -/* NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT - Sets default values of +/* NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT - Sets default values of * cooler. */ #define NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT 321 /* -W-C */ -/* - * NV_CTRL_THERMAL_COOLER_CONTROL_TYPE - +/* + * NV_CTRL_THERMAL_COOLER_CONTROL_TYPE - * Returns a cooler's control signal characteristics. * The possible types are restricted, Variable and Toggle. */ #define NV_CTRL_THERMAL_COOLER_CONTROL_TYPE 322 /* R--C */ #define NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_NONE 0 -#define NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_TOGGLE 1 +#define NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_TOGGLE 1 #define NV_CTRL_THERMAL_COOLER_CONTROL_TYPE_VARIABLE 2 -/* +/* * NV_CTRL_THERMAL_COOLER_TARGET - Returns objects that cooler cools. * Targets may be GPU, Memory, Power Supply or All of these. * GPU_RELATED = GPU | MEMORY | POWER_SUPPLY - * + * */ #define NV_CTRL_THERMAL_COOLER_TARGET 323 /* R--C */ @@ -2515,7 +2516,7 @@ #define NV_CTRL_THERMAL_COOLER_TARGET_GPU_RELATED \ (NV_CTRL_THERMAL_COOLER_TARGET_GPU | \ NV_CTRL_THERMAL_COOLER_TARGET_MEMORY | \ - NV_CTRL_THERMAL_COOLER_TARGET_POWER_SUPPLY) + NV_CTRL_THERMAL_COOLER_TARGET_POWER_SUPPLY) /* * NV_CTRL_GPU_ECC_SUPPORTED - Reports whether ECC is supported by the @@ -2799,13 +2800,13 @@ #define NV_CTRL_CURRENT_DITHERING_MODE_STATIC_2X2 2 #define NV_CTRL_CURRENT_DITHERING_MODE_TEMPORAL 3 -/* +/* * NV_CTRL_THERMAL_SENSOR_READING - Returns the thermal sensor's current * reading. */ #define NV_CTRL_THERMAL_SENSOR_READING 355 /* R--S */ -/* +/* * NV_CTRL_THERMAL_SENSOR_PROVIDER - Returns the hardware device that * provides the thermal sensor. */ @@ -2826,7 +2827,7 @@ #define NV_CTRL_THERMAL_SENSOR_PROVIDER_OS 13 #define NV_CTRL_THERMAL_SENSOR_PROVIDER_UNKNOWN 0xFFFFFFFF -/* +/* * NV_CTRL_THERMAL_SENSOR_TARGET - Returns what hardware component * the thermal sensor is measuring. */ @@ -3049,7 +3050,7 @@ /* * NV_CTRL_3D_VISION_PRO_GLASSES_PAIR_EVENT - This attribute is sent - * as an event when glasses get paired in response to pair command + * as an event when glasses get paired in response to pair command * from any of the clients. */ #define NV_CTRL_3D_VISION_PRO_GLASSES_PAIR_EVENT 382 /* ---T */ @@ -3061,13 +3062,13 @@ */ #define NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT 383 /* ---T */ -/* +/* * NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH - returns the current * PCIe link width, in number of lanes. */ #define NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH 384 /* R--GI */ -/* +/* * NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED - returns the current * PCIe link speed, in megatransfers per second (GT/s). */ @@ -3103,8 +3104,8 @@ #define NV_CTRL_DISPLAY_ENABLED_TRUE 1 #define NV_CTRL_DISPLAY_ENABLED_FALSE 0 -/* - * NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE: this is the rate +/* + * NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE: this is the rate * of an incoming house sync signal to the frame lock board, in milliHz. * * This attribute may be queried through XNVCTRLQueryTargetAttribute() @@ -3114,13 +3115,13 @@ #define NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE 389 /* R--F */ /* - * NV_CTRL_FXAA - enables FXAA. A pixel shader based anti- + * NV_CTRL_FXAA - enables FXAA. A pixel shader based anti- * aliasing method. */ #define NV_CTRL_FXAA 390 /* RW-X */ #define NV_CTRL_FXAA_DISABLE 0 #define NV_CTRL_FXAA_ENABLE 1 - + /* * NV_CTRL_DISPLAY_RANDR_OUTPUT_ID - the RandR Output ID (type RROutput) * that corresponds to the specified Display Device target. If a new @@ -3155,7 +3156,7 @@ #define NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY 393 /* R--G */ /* - * NV_CTRL_USED_DEDICATED_GPU_MEMORY- Returns the amount of video memory + * NV_CTRL_USED_DEDICATED_GPU_MEMORY- Returns the amount of video memory * currently used on the graphics card in MB. */ #define NV_CTRL_USED_DEDICATED_GPU_MEMORY 394 /* R--G */ @@ -3243,13 +3244,13 @@ /* * NV_CTRL_GPU_LOGO_BRIGHTNESS - Controls brightness * of the logo on the GPU, if any. The value is variable from 0% - 100%. - */ + */ #define NV_CTRL_GPU_LOGO_BRIGHTNESS 403 /* RW-G */ /* * NV_CTRL_GPU_SLI_LOGO_BRIGHTNESS - Controls brightness of the logo * on the SLI bridge, if any. The value is variable from 0% - 100%. - */ + */ #define NV_CTRL_GPU_SLI_LOGO_BRIGHTNESS 404 /* RW-G */ /* @@ -3646,7 +3647,7 @@ * * String attributes can be queryied through the XNVCTRLQueryStringAttribute() * and XNVCTRLQueryTargetStringAttribute() function calls. - * + * * String attributes can be set through the XNVCTRLSetStringAttribute() * function call. (There are currently no string attributes that can be * set on non-X Screen targets.) @@ -3722,7 +3723,7 @@ #define NV_CTRL_STRING_GVO_FIRMWARE_VERSION 8 /* renamed */ -/* +/* * NV_CTRL_STRING_CURRENT_MODELINE - Return the ModeLine currently * being used by the specified display device. * @@ -3738,7 +3739,7 @@ #define NV_CTRL_STRING_CURRENT_MODELINE 9 /* R-DG */ -/* +/* * NV_CTRL_STRING_ADD_MODELINE - Adds a ModeLine to the specified * display device. The ModeLine is not added if validation fails. * @@ -3766,7 +3767,7 @@ #define NV_CTRL_STRING_DELETE_MODELINE 11 /* -WDG */ -/* +/* * NV_CTRL_STRING_CURRENT_METAMODE - Returns the metamode currently * being used by the specified X screen. The MetaMode string has the * same syntax as the MetaMode X configuration option, as documented @@ -3784,7 +3785,7 @@ -/* +/* * NV_CTRL_STRING_ADD_METAMODE - Adds a MetaMode to the specified * X Screen. * @@ -3862,7 +3863,7 @@ #define NV_CTRL_STRING_VCSC_HARDWARE_REVISION 22 -/* +/* * NV_CTRL_STRING_MOVE_METAMODE - Moves a MetaMode to the specified * index location. The MetaMode must already exist in the X Screen's * list of MetaModes (as returned by the NV_CTRL_BINARY_DATA_METAMODES @@ -4081,7 +4082,7 @@ * format specified in the display_mask field; eg: * * XNVCTRLQueryStringAttribute(dpy, - * screen, + * screen, * NV_CTRL_GVIO_VIDEO_FORMAT_720P_60_00_SMPTE296, * NV_CTRL_GVIO_VIDEO_FORMAT_NAME, * &name); @@ -4356,7 +4357,7 @@ * * Binary data attributes can be queryied through the XNVCTRLQueryBinaryData() * and XNVCTRLQueryTargetBinaryData() function calls. - * + * * There are currently no binary data attributes that can be set. * * Unless otherwise noted, all Binary data attributes can be queried @@ -4377,7 +4378,7 @@ #define NV_CTRL_BINARY_DATA_EDID 0 /* R-DG */ -/* +/* * NV_CTRL_BINARY_DATA_MODELINES - Returns a display device's supported * ModeLines. ModeLines are returned in a buffer, separated by a single * '\0' and terminated by two consecutive '\0' s like so: @@ -4398,7 +4399,7 @@ * "vesa" - this is a VESA standard ModeLine * "edid" - the ModeLine was in the display device's EDID * "nv-control" - the ModeLine was specified via NV-CONTROL - * + * * "xconfig-name" - for ModeLines that were specified in the X config * file, this is the name the X config file * gave for the ModeLine. @@ -4421,7 +4422,7 @@ #define NV_CTRL_BINARY_DATA_MODELINES 1 /* R-DG */ -/* +/* * NV_CTRL_BINARY_DATA_METAMODES - Returns an X Screen's supported * MetaModes. MetaModes are returned in a buffer separated by a * single '\0' and terminated by two consecutive '\0' s like so: @@ -4912,7 +4913,7 @@ * An example input string might look like: * * "stream=0, link0=jack0, link1=jack1; stream=1, link0=jack2.1" - * + * * This example specifies two streams, stream 0 and stream 1. Stream 0 * is defined to capture link0 data from the first channel (channel 0) of * BNC jack 0 and link1 data from the first channel of BNC jack 1. The @@ -4925,7 +4926,7 @@ * * Applications should query the following attributes to determine * possible combinations: - * + * * NV_CTRL_GVI_MAX_STREAMS * NV_CTRL_GVI_MAX_LINKS_PER_STREAM * NV_CTRL_GVI_NUM_JACKS diff --git a/src/libXNVCtrl/utils.mk b/src/libXNVCtrl/utils.mk index 2b158806..d181021d 100644 --- a/src/libXNVCtrl/utils.mk +++ b/src/libXNVCtrl/utils.mk @@ -127,6 +127,7 @@ endif ifndef TARGET_ARCH TARGET_ARCH := $(shell uname -m) + TARGET_ARCH := $(subst amd64,x86_64,$(TARGET_ARCH)) TARGET_ARCH := $(subst i386,x86,$(TARGET_ARCH)) TARGET_ARCH := $(subst i486,x86,$(TARGET_ARCH)) TARGET_ARCH := $(subst i586,x86,$(TARGET_ARCH)) @@ -159,6 +160,18 @@ else LIBDL_LIBS = endif +LLD_EMULATION = + +ifneq ($(shell $(LD) -v | grep LLD),) + ifeq ($(TARGET_ARCH),x86) + LLD_EMULATION := -m elf_i386 + endif + + ifeq ($(TARGET_ARCH),x86_64) + LLD_EMULATION := -m elf_x86_64 + endif +endif + # This variable controls which floating-point ABI is targeted. For ARM, it # defaults to "gnueabi" for softfp. Another option is "gnueabihf" for # hard(fp). This is necessary to pick up the correct rtld_test binary. @@ -475,7 +488,7 @@ endef # This is a function that will generate rules to build # files with separate debug information, if so requested. -# +# # It takes one parameter: (1) Name of unstripped binary # # When used, the target for linking should be named (1).unstripped @@ -547,7 +560,7 @@ define READ_ONLY_OBJECT_FROM_FILE_RULE $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1) $(at_if_quiet)$$(MKDIR) $$(OUTPUTDIR) $(at_if_quiet)cd $$(dir $(1)); \ - $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \ + $$(call quiet_cmd_no_at,LD) $(LLD_EMULATION) -r -z noexecstack --format=binary \ $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@) $$(call quiet_cmd,OBJCOPY) \ --rename-section .data=.rodata,contents,alloc,load,data,readonly \ diff --git a/src/parse.c b/src/parse.c index f6f641df..60c2538f 100644 --- a/src/parse.c +++ b/src/parse.c @@ -67,7 +67,7 @@ const AttributeTableEntry attributeTable[] = { */ /* Version information */ - { "OperatingSystem", NV_CTRL_OPERATING_SYSTEM, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "The operating system on which the NVIDIA driver is running. 0-Linux, 1-FreeBSD, 2-SunOS." }, + { "OperatingSystem", NV_CTRL_OPERATING_SYSTEM, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "The operating system on which the NVIDIA driver is running. 0-Linux, 1-FreeBSD, 2-SunOS, 3-Generic." }, { "NvidiaDriverVersion", NV_CTRL_STRING_NVIDIA_DRIVER_VERSION, STR_ATTR, {0,0,0,1,0}, {}, "The NVIDIA X driver version." }, { "NvControlVersion", NV_CTRL_STRING_NV_CONTROL_VERSION, STR_ATTR, {0,0,0,1,0}, {}, "The NV-CONTROL X driver extension version." }, { "GLXServerVersion", NV_CTRL_STRING_GLX_SERVER_VERSION, STR_ATTR, {0,0,0,1,0}, {}, "The GLX X server extension version." }, @@ -151,7 +151,7 @@ const AttributeTableEntry attributeTable[] = { { "GPUAmbientTemp", NV_CTRL_AMBIENT_TEMPERATURE, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Reports the current temperature in Celsius of the immediate neighborhood of the GPU driving the X screen." }, { "GPUGraphicsClockOffset", NV_CTRL_GPU_NVCLOCK_OFFSET, INT_ATTR, {0,0,1,1,1}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset amount, in MHz, to over- or under-clock the Graphics Clock. Specify the performance level in square brackets after the attribute name. E.g., 'GPUGraphicsClockOffset[2]'." }, { "GPUMemoryTransferRateOffset", NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET, INT_ATTR, {0,0,1,1,1}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset amount, in MHz, to over- or under-clock the Memory Transfer Rate. Specify the performance level in square brackets after the attribute name. E.g., 'GPUMemoryTransferRateOffset[2]'." }, - { "GPUGraphicsClockOffsetAllPerformanceLevels", NV_CTRL_GPU_NVCLOCK_OFFSET_ALL_PERFORMANCE_LEVELS, INT_ATTR, {0,0,1,1,1}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset amount, in MHz, to over- or under-clock the Graphics Clock. The offset is applied to all performance levels. This attribute is available starting with Pascal GPUs." }, + { "GPUGraphicsClockOffsetAllPerformanceLevels", NV_CTRL_GPU_NVCLOCK_OFFSET_ALL_PERFORMANCE_LEVELS, INT_ATTR, {0,0,1,1,1}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset amount, in MHz, to over- or under-clock the Graphics Clock. The offset is applied to all performance levels. This attribute is available starting with Pascal GPUs." }, { "GPUMemoryTransferRateOffsetAllPerformanceLevels", NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET_ALL_PERFORMANCE_LEVELS, INT_ATTR, {0,0,1,1,1}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset amount, in MHz, to over- or under-clock the Memory Transfer Rate. The offset is applied to all performance levels. This attribute is available starting with Pascal GPUs." }, { "GPUCurrentCoreVoltage", NV_CTRL_GPU_CURRENT_CORE_VOLTAGE, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "This attribute returns the GPU's current operating voltage, in microvolts (uV)."}, { "GPUOverVoltageOffset", NV_CTRL_GPU_OVER_VOLTAGE_OFFSET, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "This is the offset, in microvolts (uV), to apply to the GPU's operating voltage."}, @@ -195,7 +195,7 @@ const AttributeTableEntry attributeTable[] = { { "GPUFanTarget", NV_CTRL_THERMAL_COOLER_TARGET, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns the objects the fan cools. '1' means the GPU, '2' means video memory, '4' means the power supply, and '7' means all of the above." }, { "ThermalSensorReading", NV_CTRL_THERMAL_SENSOR_READING, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns the thermal sensor's current reading." }, { "ThermalSensorProvider", NV_CTRL_THERMAL_SENSOR_PROVIDER, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns the hardware device that provides the thermal sensor." }, - { "ThermalSensorTarget", NV_CTRL_THERMAL_SENSOR_TARGET, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns what hardware component the thermal sensor is measuring." }, + { "ThermalSensorTarget", NV_CTRL_THERMAL_SENSOR_TARGET, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns what hardware component the thermal sensor is measuring." }, { "BaseMosaic", NV_CTRL_BASE_MOSAIC, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns the current Base Mosaic configuration." }, { "MultiGpuPrimaryPossible", NV_CTRL_MULTIGPU_PRIMARY_POSSIBLE, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns whether or not the GPU can be configured as the primary GPU for a Multi GPU configuration (SLI, SLI Mosaic, Base Mosaic, ...)." }, { "MultiGpuMasterPossible", NV_CTRL_MULTIGPU_PRIMARY_POSSIBLE, INT_ATTR, {0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "This attribute is deprecated. Please use 'MultiGpuPrimaryPossible' instead." }, @@ -656,16 +656,16 @@ int nv_parse_attribute_string(const char *str, int query, ParsedAttribute *p) } /* move past the DISPLAY_NAME_SEPARATOR */ - + if (s) s++; else s = no_spaces; - + /* read the attribute name */ name = s; len = 0; while (*s && isalnum(*s)) { s++; len++; } - + if (len == 0) stop(NV_PARSER_STATUS_ATTR_NAME_MISSING); if (len >= NV_PARSER_MAX_NAME_LEN) stop(NV_PARSER_STATUS_ATTR_NAME_TOO_LONG); @@ -895,7 +895,7 @@ int nv_strcasecmp(const char *a, const char *b) * * If a parse error occurs, INVALID_DISPLAY_DEVICE_MASK is returned, * otherwise the display mask is returned. - + */ static uint32 display_device_name_to_display_device_mask(const char *str) @@ -941,7 +941,7 @@ static uint32 display_device_name_to_display_device_mask(const char *str) /* match each token, updating mask as appropriate */ for (i = 0; i < n; i++) { - + if (nv_strcasecmp(toks[i], "CRT-0")) mask |= ((1 << 0) << 0); else if (nv_strcasecmp(toks[i], "CRT-1")) mask |= ((1 << 1) << 0); else if (nv_strcasecmp(toks[i], "CRT-2")) mask |= ((1 << 2) << 0); @@ -968,13 +968,13 @@ static uint32 display_device_name_to_display_device_mask(const char *str) else if (nv_strcasecmp(toks[i], "DFP-5")) mask |= ((1 << 5) << 16); else if (nv_strcasecmp(toks[i], "DFP-6")) mask |= ((1 << 6) << 16); else if (nv_strcasecmp(toks[i], "DFP-7")) mask |= ((1 << 7) << 16); - + else if (nv_strcasecmp(toks[i], "CRT")) mask |= DISPLAY_DEVICES_WILDCARD_CRT; - + else if (nv_strcasecmp(toks[i], "TV")) mask |= DISPLAY_DEVICES_WILDCARD_TV; - + else if (nv_strcasecmp(toks[i], "DFP")) mask |= DISPLAY_DEVICES_WILDCARD_DFP; @@ -983,13 +983,13 @@ static uint32 display_device_name_to_display_device_mask(const char *str) break; } } - + nv_free_strtoks(toks, n); - + free(s); return mask; - + } /* display_name_to_display_device_mask() */ @@ -1037,7 +1037,7 @@ char *display_device_mask_to_display_device_name(const uint32 mask) devmask <<= 1; devcnt++; } - + devmask = 1 << BITSHIFT_TV; devcnt = 0; while (devmask & BITMASK_ALL_TV) { @@ -1049,7 +1049,7 @@ char *display_device_mask_to_display_device_name(const uint32 mask) devmask <<= 1; devcnt++; } - + if (mask & DISPLAY_DEVICES_WILDCARD_CRT) { if (first) first = NV_FALSE; else s += sprintf(s, ", "); @@ -1067,9 +1067,9 @@ char *display_device_mask_to_display_device_name(const uint32 mask) else s += sprintf(s, ", "); s += sprintf(s, "DFP"); } - + *s = '\0'; - + return (display_device_name_string); } /* display_device_mask_to_display_name() */ @@ -1220,23 +1220,23 @@ char *nv_standardize_screen_name(const char *orig, int screen) char *display_name, *screen_name, *colon, *dot, *tmp; struct utsname uname_buf; int len; - + /* get the string describing this display connection */ - + if (!orig) return NULL; - + /* create a working copy */ - + display_name = strdup(orig); if (!display_name) return NULL; - + /* skip past the host */ - + colon = strchr(display_name, ':'); if (!colon) return NULL; - + /* if no host is specified, prepend the local hostname */ - + /* XXX should we try to catch "localhost"? */ if (display_name == colon) { @@ -1253,12 +1253,12 @@ char *nv_standardize_screen_name(const char *orig, int screen) } } } - + /* * if the screen parameter is -1, then extract the screen number, * either from the string or default to 0 */ - + if (screen == -1) { dot = strchr(colon, '.'); if (dot) { @@ -1267,13 +1267,13 @@ char *nv_standardize_screen_name(const char *orig, int screen) screen = 0; } } - + /* * find the separation between the display and the screen; if we * find it, then truncate the string before the screen, so that we * can append the correct screen number. */ - + dot = strchr(colon, '.'); if (dot) *dot = '\0'; @@ -1281,7 +1281,7 @@ char *nv_standardize_screen_name(const char *orig, int screen) * if the screen parameter is -2, then do not write out a screen * number. */ - + if (screen == -2) { screen_name = display_name; } else { @@ -1290,7 +1290,7 @@ char *nv_standardize_screen_name(const char *orig, int screen) snprintf(screen_name, len, "%s.%d", display_name, screen); free(display_name); } - + return (screen_name); } /* nv_standardize_screen_name() */ @@ -1306,11 +1306,11 @@ char *remove_spaces(const char *o) { int len; char *m, *no_spaces; - + if (!o) return (NULL); - + len = strlen (o); - + no_spaces = nvalloc(len + 1); m = no_spaces; @@ -1319,7 +1319,7 @@ char *remove_spaces(const char *o) o++; } *m = '\0'; - + len = m - no_spaces + 1; no_spaces = realloc (no_spaces, len); @@ -1380,14 +1380,14 @@ char **nv_strtok(char *s, char c, int *n) { int count, i, len; char **delims, **tokens, *m; - + count = count_number_of_chars(s, c); - + /* * allocate and set pointers to each division (each instance of the * dividing character, and the terminating NULL of the string) */ - + delims = nvalloc((count + 1) * sizeof(char *)); m = s; for (i = 0; i < count; i++) { @@ -1396,26 +1396,26 @@ char **nv_strtok(char *s, char c, int *n) m++; } delims[count] = (char *) strchr(s, '\0'); - + /* * so now, we have pointers to each delimiter; copy what's in between * the divisions (the tokens) into the dynamic array of strings */ - + tokens = nvalloc((count + 1) * sizeof(char *)); len = delims[0] - s; tokens[0] = nvstrndup(s, len); - + for (i = 1; i < count+1; i++) { len = delims[i] - delims[i-1]; tokens[i] = nvstrndup(delims[i-1]+1, len-1); } - + free(delims); - + *n = count+1; return (tokens); - + } /* nv_strtok() */ @@ -1430,7 +1430,7 @@ void nv_free_strtoks(char **s, int n) int i; for (i = 0; i < n; i++) free(s[i]); free(s); - + } /* nv_free_strtoks() */ @@ -1460,7 +1460,7 @@ static int count_number_of_chars(char *o, char d) o++; } return (c); - + } /* count_number_of_chars() */ @@ -1511,7 +1511,7 @@ const char *parse_skip_whitespace(const char *str) void parse_chop_whitespace(char *str) { char *tmp = str + strlen(str) -1; - + while (tmp >= str && (*tmp == ' ' || *tmp == '\t' || *tmp == '\n' || *tmp == '\r')) { @@ -1717,7 +1717,7 @@ int parse_read_float_range(const char *str, float *min, float *max) } str++; *max = atof(str); - + return 1; } /* parse_read_float_range() */ diff --git a/utils.mk b/utils.mk index 2b158806..79d11a0f 100644 --- a/utils.mk +++ b/utils.mk @@ -56,6 +56,8 @@ HOST_BIN_LDFLAGS ?= # always disable warnings that will break the build CC_ONLY_CFLAGS += -Wno-format-zero-length CFLAGS += -Wno-unused-parameter +CFLAGS += -Wno-deprecated-declarations +CFLAGS += -Wno-unknown-warning-option HOST_CC_ONLY_CFLAGS += -Wno-format-zero-length HOST_CFLAGS += -Wno-unused-parameter @@ -127,6 +129,7 @@ endif ifndef TARGET_ARCH TARGET_ARCH := $(shell uname -m) + TARGET_ARCH := $(subst amd64,x86_64,$(TARGET_ARCH)) TARGET_ARCH := $(subst i386,x86,$(TARGET_ARCH)) TARGET_ARCH := $(subst i486,x86,$(TARGET_ARCH)) TARGET_ARCH := $(subst i586,x86,$(TARGET_ARCH)) @@ -159,6 +162,18 @@ else LIBDL_LIBS = endif +LLD_EMULATION = + +ifneq ($(shell $(LD) -v | grep LLD),) + ifeq ($(TARGET_ARCH),x86) + LLD_EMULATION := -m elf_i386 + endif + + ifeq ($(TARGET_ARCH),x86_64) + LLD_EMULATION := -m elf_x86_64 + endif +endif + # This variable controls which floating-point ABI is targeted. For ARM, it # defaults to "gnueabi" for softfp. Another option is "gnueabihf" for # hard(fp). This is necessary to pick up the correct rtld_test binary. @@ -475,7 +490,7 @@ endef # This is a function that will generate rules to build # files with separate debug information, if so requested. -# +# # It takes one parameter: (1) Name of unstripped binary # # When used, the target for linking should be named (1).unstripped @@ -547,7 +562,7 @@ define READ_ONLY_OBJECT_FROM_FILE_RULE $$(OUTPUTDIR)/$$(notdir $(1)).o: $(1) $(at_if_quiet)$$(MKDIR) $$(OUTPUTDIR) $(at_if_quiet)cd $$(dir $(1)); \ - $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \ + $$(call quiet_cmd_no_at,LD) $(LLD_EMULATION) -r -z noexecstack --format=binary \ $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@) $$(call quiet_cmd,OBJCOPY) \ --rename-section .data=.rodata,contents,alloc,load,data,readonly \