浏览代码

plugins: Cleanup unused-parameters

- Remove unnecessary UNUSED_PARAMETER
- Add OBS_UNUSED attribute to unused parameters
- Also removes unused variables
Norihiro Kamae 3 年之前
父节点
当前提交
7e3656ab33

+ 0 - 2
plugins/aja/aja-common.cpp

@@ -241,8 +241,6 @@ void populate_sdi_4k_transport_list(obs_property_t *list)
 bool aja_video_format_changed(obs_properties_t *props, obs_property_t *list,
 			      obs_data_t *settings)
 {
-	UNUSED_PARAMETER(list);
-
 	auto vid_fmt = static_cast<NTV2VideoFormat>(
 		obs_data_get_int(settings, kUIPropVideoFormatSelect.id));
 	size_t itemCount = obs_property_list_item_count(list);

+ 0 - 2
plugins/aja/aja-output.cpp

@@ -868,8 +868,6 @@ bool aja_output_device_changed(void *data, obs_properties_t *props,
 bool aja_output_dest_changed(obs_properties_t *props, obs_property_t *list,
 			     obs_data_t *settings)
 {
-	UNUSED_PARAMETER(props);
-
 	blog(LOG_DEBUG, "AJA Output Dest Changed");
 
 	const char *cardID = obs_data_get_string(settings, kUIPropDevice.id);

+ 0 - 2
plugins/image-source/color-source.c

@@ -31,8 +31,6 @@ static void color_source_update(void *data, obs_data_t *settings)
 
 static void *color_source_create(obs_data_t *settings, obs_source_t *source)
 {
-	UNUSED_PARAMETER(source);
-
 	struct color_source *context = bzalloc(sizeof(struct color_source));
 	context->src = source;
 

+ 2 - 1
plugins/linux-capture/xcomposite-input.c

@@ -382,7 +382,8 @@ static enum gs_color_format gs_format_from_tex()
 	}
 }
 
-static int silence_x11_errors(Display *display, XErrorEvent *err)
+static int silence_x11_errors(Display *display OBS_UNUSED,
+			      XErrorEvent *err OBS_UNUSED)
 {
 	return 0;
 }

+ 0 - 3
plugins/linux-pipewire/pipewire.c

@@ -710,7 +710,6 @@ static void on_state_changed_cb(void *user_data, enum pw_stream_state old,
 				enum pw_stream_state state, const char *error)
 {
 	UNUSED_PARAMETER(old);
-	UNUSED_PARAMETER(error);
 
 	obs_pipewire_data *obs_pw = user_data;
 
@@ -736,8 +735,6 @@ static void on_core_info_cb(void *user_data, const struct pw_core_info *info)
 static void on_core_error_cb(void *user_data, uint32_t id, int seq, int res,
 			     const char *message)
 {
-	UNUSED_PARAMETER(seq);
-
 	obs_pipewire_data *obs_pw = user_data;
 
 	blog(LOG_ERROR, "[pipewire] Error id:%u seq:%d res:%d (%s): %s", id,

+ 0 - 1
plugins/linux-pipewire/screencast-portal.c

@@ -600,7 +600,6 @@ init_screencast_capture(struct screencast_portal_capture *capture)
 {
 	GDBusConnection *connection;
 	GDBusProxy *proxy;
-	char *aux;
 
 	capture->cancellable = g_cancellable_new();
 	connection = portal_get_dbus_connection();

+ 0 - 4
plugins/mac-capture/mac-display-capture.m

@@ -150,7 +150,6 @@ static inline void display_stream_update(struct display_capture *dc,
 					 CGDisplayStreamUpdateRef update_ref)
 {
 	UNUSED_PARAMETER(display_time);
-	UNUSED_PARAMETER(update_ref);
 
 	if (status == kCGDisplayStreamFrameStatusStopped) {
 		os_event_signal(dc->disp_finished);
@@ -251,9 +250,6 @@ void load_crop(struct display_capture *dc, obs_data_t *settings);
 
 static void *display_capture_create(obs_data_t *settings, obs_source_t *source)
 {
-	UNUSED_PARAMETER(source);
-	UNUSED_PARAMETER(settings);
-
 	struct display_capture *dc = bzalloc(sizeof(struct display_capture));
 
 	dc->source = source;

+ 0 - 4
plugins/mac-syphon/syphon.m

@@ -451,8 +451,6 @@ static inline void syphon_destroy_internal(syphon_t s);
 
 static void *syphon_create_internal(obs_data_t *settings, obs_source_t *source)
 {
-	UNUSED_PARAMETER(source);
-
 	syphon_t s = bzalloc(sizeof(struct syphon));
 	if (!s)
 		return s;
@@ -1039,8 +1037,6 @@ static inline void tick_inject_state(syphon_t s, float seconds)
 
 static void syphon_video_tick(void *data, float seconds)
 {
-	UNUSED_PARAMETER(seconds);
-
 	syphon_t s = data;
 
 	if (s->inject_active && !s->inject_server_found)

+ 0 - 1
plugins/obs-ffmpeg/obs-ffmpeg-mux.c

@@ -917,7 +917,6 @@ static void replay_buffer_hotkey(void *data, obs_hotkey_id id,
 {
 	UNUSED_PARAMETER(id);
 	UNUSED_PARAMETER(hotkey);
-	UNUSED_PARAMETER(pressed);
 
 	if (!pressed)
 		return;

+ 0 - 3
plugins/obs-ffmpeg/obs-ffmpeg-source.c

@@ -128,7 +128,6 @@ static obs_properties_t *ffmpeg_source_getproperties(void *data)
 	struct ffmpeg_source *s = data;
 	struct dstr filter = {0};
 	struct dstr path = {0};
-	UNUSED_PARAMETER(data);
 
 	obs_properties_t *props = obs_properties_create();
 
@@ -611,8 +610,6 @@ static void ffmpeg_source_stop_hotkey(void *data, obs_hotkey_id id,
 
 static void *ffmpeg_source_create(obs_data_t *settings, obs_source_t *source)
 {
-	UNUSED_PARAMETER(settings);
-
 	struct ffmpeg_source *s = bzalloc(sizeof(struct ffmpeg_source));
 	s->source = source;
 

+ 0 - 1
plugins/obs-filters/color-grade-filter.c

@@ -413,7 +413,6 @@ static obs_properties_t *color_grade_filter_properties(void *data)
 	dstr_free(&filter_str);
 	dstr_free(&path);
 
-	UNUSED_PARAMETER(data);
 	return props;
 }
 

+ 0 - 1
plugins/obs-filters/compressor-filter.c

@@ -533,7 +533,6 @@ static obs_properties_t *compressor_properties(void *data)
 	struct sidechain_prop_info info = {sources, parent};
 	obs_enum_sources(add_sources, &info);
 
-	UNUSED_PARAMETER(data);
 	return props;
 }
 

+ 0 - 4
plugins/obs-qsv11/obs-qsv11.c

@@ -775,10 +775,6 @@ static bool obs_qsv_sei(void *data, uint8_t **sei, size_t *size)
 	if (!obsqsv->context)
 		return false;
 
-	/* (Jim) Unused */
-	UNUSED_PARAMETER(sei);
-	UNUSED_PARAMETER(size);
-
 	*sei = obsqsv->sei;
 	*size = obsqsv->sei_size;
 	return true;

+ 0 - 2
plugins/obs-transitions/transition-luma-wipe.c

@@ -64,8 +64,6 @@ static void luma_wipe_update(void *data, obs_data_t *settings)
 
 	bfree(file);
 	dstr_free(&path);
-
-	UNUSED_PARAMETER(settings);
 }
 
 static void luma_wipe_get_list(void *data)

+ 0 - 1
plugins/obs-transitions/transition-swipe.c

@@ -48,7 +48,6 @@ static void *swipe_create(obs_data_t *settings, obs_source_t *source)
 
 	obs_source_update(source, settings);
 
-	UNUSED_PARAMETER(settings);
 	return swipe;
 }
 

+ 0 - 2
plugins/rtmp-services/rtmp-custom.c

@@ -115,8 +115,6 @@ static const char *rtmp_custom_password(void *data)
 static void rtmp_custom_apply_settings(void *data, obs_data_t *video_settings,
 				       obs_data_t *audio_settings)
 {
-	UNUSED_PARAMETER(audio_settings);
-
 	struct rtmp_custom *service = data;
 	if (service->server != NULL && video_settings != NULL &&
 	    strncmp(service->server, RTMP_PROTOCOL, strlen(RTMP_PROTOCOL)) !=

+ 0 - 2
plugins/vlc-video/vlc-video-source.c

@@ -446,8 +446,6 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
 	enum video_format new_format;
 	enum video_range_type range;
 	bool new_range;
-	unsigned new_width = 0;
-	unsigned new_height = 0;
 	size_t i = 0;
 
 	new_format = convert_vlc_video_format(chroma, &new_range);

+ 0 - 2
plugins/win-capture/duplicator-monitor-capture.c

@@ -460,8 +460,6 @@ static void duplicator_capture_tick(void *data, float seconds)
 
 	if (!capture->showing)
 		capture->showing = true;
-
-	UNUSED_PARAMETER(seconds);
 }
 
 static uint32_t duplicator_capture_width(void *data)

+ 0 - 1
plugins/win-capture/game-capture.c

@@ -2420,7 +2420,6 @@ static obs_properties_t *game_capture_properties(void *data)
 	obs_property_list_add_string(p, TEXT_RGBA10A2_SPACE_2100PQ,
 				     RGBA10A2_SPACE_2100PQ);
 
-	UNUSED_PARAMETER(data);
 	return ppts;
 }
 

+ 0 - 1
plugins/win-dshow/win-dshow-encoder.cpp

@@ -161,7 +161,6 @@ static inline void *CreateDShowEncoder(obs_data_t *settings,
 		     obs_encoder_get_name(context), error);
 	}
 
-	UNUSED_PARAMETER(settings);
 	return encoder;
 }
 

+ 0 - 1
plugins/win-dshow/win-dshow.cpp

@@ -1953,7 +1953,6 @@ static bool DeviceIntervalChanged(obs_properties_t *props, obs_property_t *p,
 	UpdateVideoFormats(device, format, cx, cy, val, props);
 	UpdateFPS(device, format, val, cx, cy, props);
 
-	UNUSED_PARAMETER(p);
 	return true;
 }