After being beaten by missing returns I tried to re-run cppcheck 2.8 over
cin-gg codebase.

Few issues I do not know how to correct, for others I have patches to test

I think they definitely for next month testing
From 9e2b0a95d4313ec703244e87c98bd4f54a5c61ec Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 01:33:49 +0300
Subject: [PATCH 2/7] Experimental: void types in pluginmessages.h (cppcheck)

---
 cinelerra-5.1/cinelerra/pluginmessages.h | 26 ++++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/pluginmessages.h b/cinelerra-5.1/cinelerra/pluginmessages.h
index f45c9bd1..0a63dd90 100644
--- a/cinelerra-5.1/cinelerra/pluginmessages.h
+++ b/cinelerra-5.1/cinelerra/pluginmessages.h
@@ -32,19 +32,19 @@ public:
 	PluginMessages(int input_flag, int output_flag, int message_id = -1);
 	~PluginMessages();
 
-	send_message(char *text);
-	receive_message(char *text);
-
-	send_message(int command, char *text);
-	send_message(long command, long value);
-	send_message(long command, long value1, long value2);
-	send_message(int command);
-
-	receive_message();     // returns the command
-	receive_message(int *command, char *text);
-	receive_message(int *command, long *value);
-	receive_message(long *value1, long *value2);
-	receive_message(int *command, long *value1, long *value2);
+	void send_message(char *text);
+	void receive_message(char *text);
+
+	void send_message(int command, char *text);
+	void send_message(long command, long value);
+	void send_message(long command, long value1, long value2);
+	void send_message(int command);
+
+	void receive_message();     // returns the command
+	void receive_message(int *command, char *text);
+	void receive_message(int *command, long *value);
+	void receive_message(long *value1, long *value2);
+	void receive_message(int *command, long *value1, long *value2);
 
 	Messages *messages;
 	int input_flag, output_flag;
-- 
2.36.1

From cc6a42b548bf8c42db47c0f0cea1571f554ea9a0 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 01:33:08 +0300
Subject: [PATCH 1/7] two missed returns in pluginprefs

---
 cinelerra-5.1/cinelerra/pluginprefs.C | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/pluginprefs.C b/cinelerra-5.1/cinelerra/pluginprefs.C
index 2a3f7878..b8167bb2 100644
--- a/cinelerra-5.1/cinelerra/pluginprefs.C
+++ b/cinelerra-5.1/cinelerra/pluginprefs.C
@@ -93,6 +93,7 @@ PluginGlobalPathText::~PluginGlobalPathText() {}
 int PluginGlobalPathText::handle_event()
 {
 	strcpy(pwindow->thread->preferences->global_plugin_dir, get_text());
+return 0;
 }
 
 
@@ -110,4 +111,5 @@ PluginLocalPathText::~PluginLocalPathText() {}
 int PluginLocalPathText::handle_event()
 {
 	strcpy(pwindow->thread->preferences->local_plugin_dir, get_text());
+return 0;
 }
-- 
2.36.1

From 3ff204e10c1a90050607f7dee783247f09ce26e4 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 02:13:01 +0300
Subject: [PATCH 6/7] Experimental: missing returns in recordengine.C

---
 cinelerra-5.1/cinelerra/recordengine.C | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/recordengine.C b/cinelerra-5.1/cinelerra/recordengine.C
index 2fb14891..9e604596 100644
--- a/cinelerra-5.1/cinelerra/recordengine.C
+++ b/cinelerra-5.1/cinelerra/recordengine.C
@@ -127,6 +127,7 @@ int RecordEngine::initialize()
 	current_jump_jumps[2] = 60;
 	current_jump_jumps[3] = 80;
 	current_jump_jumps[4] = 100;
+return 0;
 }
 
 int RecordEngine::run_script(FileXML *script)
@@ -199,6 +200,7 @@ long RecordEngine::get_dc_offset(int offset)
 int RecordEngine::set_dc_offset(long new_offset, int number)
 {
 	adevice->set_dc_offset(new_offset, number);
+return 0;
 }
 
 long int RecordEngine::get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc_offset_text)
@@ -210,6 +212,7 @@ int RecordEngine::set_gui(RecordGUI *gui)
 {
 	this->gui = gui;
 	update_position(current_position);
+return 0;
 }
 
 int RecordEngine::get_duplex_enable()
@@ -491,11 +494,13 @@ int RecordEngine::close_output_devices()
 int RecordEngine::lock_window()
 {
 	gui->lock_window();
+return 0;
 }
 
 int RecordEngine::unlock_window()
 {
 	gui->unlock_window();
+return 0;
 }
 
 int RecordEngine::update_position(long new_position)
@@ -523,6 +528,7 @@ int RecordEngine::update_position(long new_position)
 
 		gui->update_next_label(next_label);
 	}
+return 0;
 }
 
 int RecordEngine::goto_prev_label()
@@ -540,6 +546,7 @@ int RecordEngine::goto_prev_label()
 			update_position(new_position);
 		}
 	}
+return 0;
 }
 
 int RecordEngine::goto_next_label()
@@ -588,6 +595,7 @@ int RecordEngine::calibrate_dc_offset(long new_value, int channel)
 
 int RecordEngine::reset_over()
 {
+return 0;
 }
 
 int RecordEngine::set_done(int value)
@@ -595,6 +603,7 @@ int RecordEngine::set_done(int value)
 	stop_operation(1);
 	stop_monitor();
 	gui->set_done(value);
+return 0;
 }
 
 int RecordEngine::start_over()
@@ -623,6 +632,7 @@ int RecordEngine::start_over()
 			record->startsource_frame = 0;
 		}
 	}
+return 0;
 }
 
 int RecordEngine::change_channel(Channel *channel)
@@ -648,6 +658,7 @@ int RecordEngine::get_format(char *string)
 {
 	File file;
 	strcpy(string, file.formattostr(mwindow->plugindb, asset->format));
+	return 0;
 }
 int RecordEngine::get_samplerate() { return asset->rate; }
 int RecordEngine::get_bits() { return asset->bits; }
@@ -665,25 +676,30 @@ float RecordEngine::get_frames_per_foot() { /* return mwindow->preferences->fram
 
 int RecordEngine::set_monitor_video(int value)
 {
+return 0;
 }
 
 int RecordEngine::set_monitor_audio(int value)
 {
+return 0;
 }
 
 int RecordEngine::set_record_mode(char *text)
 {
 	record->record_mode = text_to_mode(text);
+return 0;
 }
 
 int RecordEngine::get_record_mode(char *text)
 {
 	mode_to_text(text, record->record_mode);
+return 0;
 }
 
 int RecordEngine::get_record_mode()
 {
 	return record->record_mode;
+return 0;
 }
 
 int RecordEngine::mode_to_text(char *string, int mode)
@@ -694,6 +710,7 @@ int RecordEngine::mode_to_text(char *string, int mode)
 		case 1:        sprintf(string, _("Timed"));         break;
 		case 2:        sprintf(string, _("Loop"));          break;
 	}
+return 0;
 }
 
 int RecordEngine::text_to_mode(char *string)
@@ -701,6 +718,7 @@ int RecordEngine::text_to_mode(char *string)
 	if(!strcasecmp(string, _("Untimed"))) return 0;
 	if(!strcasecmp(string, _("Timed")))   return 1;
 	if(!strcasecmp(string, _("Loop")))    return 2;
+return 0;
 }
 
 long RecordEngine::get_current_delay()
@@ -718,11 +736,13 @@ int RecordEngine::reset_current_delay()
 {
 	current_jump_delay = 0;
 	current_jump_jump = current_jump_jumps[current_jump_delay];
+return 0;
 }
 
 int RecordEngine::set_loop_duration()
 {
 	record->set_loop_duration((long)record->get_samplerate() * (atol(gui->loop_sec->get_text()) + atol(gui->loop_min->get_text()) * 60 + atol(gui->loop_hr->get_text()) * 3600));
+return 0;
 }
 
 
-- 
2.36.1

From 79d99972e993516d41bef75911094d66eebe446c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 01:52:57 +0300
Subject: [PATCH 5/7] missing returns in formatwindow.C (cppcheck)

---
 cinelerra-5.1/cinelerra/formatwindow.C | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/formatwindow.C b/cinelerra-5.1/cinelerra/formatwindow.C
index 67f7416d..c3726c3c 100644
--- a/cinelerra-5.1/cinelerra/formatwindow.C
+++ b/cinelerra-5.1/cinelerra/formatwindow.C
@@ -142,6 +142,7 @@ FormatQuality::~FormatQuality()
 int FormatQuality::handle_event()
 {
 	asset->quality = get_value();
+return 0;
 }
 
 
@@ -152,6 +153,7 @@ FormatBits::~FormatBits() {}
 int FormatBits::handle_event()
 {
 	asset->bits = get_bits();
+return 0;
 }
 
 
@@ -162,6 +164,7 @@ FormatDither::~FormatDither() {}
 int FormatDither::handle_event()
 {
 	*dither = get_value();
+return 0;
 }
 
 
@@ -174,6 +177,7 @@ FormatSigned::~FormatSigned() {}
 int FormatSigned::handle_event()
 {
 	asset->signed_ = get_value();
+return 0;
 }
 
 
@@ -188,6 +192,7 @@ int FormatHILO::handle_event()
 {
 	asset->byte_order = get_value() ^ 1;
 	lohi->update(get_value() ^ 1);
+return 0;
 }
 
 FormatLOHI::FormatLOHI(int x, int y, FormatHILO *hilo, Asset *asset)
@@ -202,5 +207,6 @@ int FormatLOHI::handle_event()
 {
 	asset->byte_order = get_value();
 	hilo->update(get_value() ^ 1);
+return 0;
 }
 
-- 
2.36.1

From fa59d6c8662dfee3971c7bd841cee089279e6727 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 01:46:42 +0300
Subject: [PATCH 4/7] wrong dealloc type in dbwindow (cppcheck)

---
 cinelerra-5.1/cinelerra/dbwindow.C | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/dbwindow.C b/cinelerra-5.1/cinelerra/dbwindow.C
index 98070234..4bf9d0ca 100644
--- a/cinelerra-5.1/cinelerra/dbwindow.C
+++ b/cinelerra-5.1/cinelerra/dbwindow.C
@@ -840,8 +840,8 @@ DbWindowItem(int id, const char *source, const char *title,
 DbWindowItem::
 ~DbWindowItem()
 {
-	delete source;
-	delete title;
+	delete [] source;
+	delete [] title;
 }
 
 #define CmprFn(nm,key) int DbWindowGUI:: \
-- 
2.36.1

From 42f2dd48bc303aa10e1c298abdd391e961d7e98a Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 01:41:22 +0300
Subject: [PATCH 3/7] two missing returns in cropvideo.C

---
 cinelerra-5.1/cinelerra/cropvideo.C | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/cropvideo.C b/cinelerra-5.1/cinelerra/cropvideo.C
index 72aa0b9d..08adc485 100644
--- a/cinelerra-5.1/cinelerra/cropvideo.C
+++ b/cinelerra-5.1/cinelerra/cropvideo.C
@@ -87,10 +87,12 @@ void CropVideo::run()
 
 int CropVideo::load_defaults()
 {
+return 0;
 }
 
 int CropVideo::save_defaults()
 {
+return 0;
 }
 
 CropVideoWindow::CropVideoWindow(MWindow *mwindow, CropVideo *thread)
-- 
2.36.1

From 6b724abcfad2587804e3867cca64a4a3aadc081c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Tue, 31 May 2022 02:17:15 +0300
Subject: [PATCH 7/7] missing returns in scale.C

---
 cinelerra-5.1/cinelerra/scale.C | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/scale.C b/cinelerra-5.1/cinelerra/scale.C
index 860c46fb..7d682bcb 100644
--- a/cinelerra-5.1/cinelerra/scale.C
+++ b/cinelerra-5.1/cinelerra/scale.C
@@ -47,6 +47,7 @@ Scale::~Scale()
 int Scale::handle_event()
 {
 	thread->start();
+return 0;
 }
 
 ScaleThread::ScaleThread(MWindow *mwindow)
@@ -189,6 +190,7 @@ int ScaleThread::update_aspect(ScaleWindow *window)
 		sprintf(string, "%.0f", aspect_h);
 		window->aspect_h->update(string);
 	}
+return 0;
 }
 
 
@@ -307,6 +309,7 @@ int ScaleSizeText::handle_event()
 	if(*output > 10000) *output = 10000;
 	*output *= -1;
 	thread->update_window();
+return 0;
 }
 
 ScaleOffsetText::ScaleOffsetText(int x, int y, ScaleThread *thread, int *output)
@@ -320,6 +323,7 @@ int ScaleOffsetText::handle_event()
 	if(*output > 10000) *output = 10000;
 	if(*output < -10000) *output = -10000;
 	thread->update_window(1);
+return 0;
 }
 
 ScaleRatioText::ScaleRatioText(int x, int y, ScaleThread *thread, float *output)
@@ -334,6 +338,7 @@ int ScaleRatioText::handle_event()
 	if(*output < -10000) *output = -10000;
 	*output *= -1;
 	thread->update_window();
+return 0;
 }
 
 
@@ -346,6 +351,7 @@ ScaleConstrain::~ScaleConstrain() {}
 int ScaleConstrain::handle_event()
 {
 	thread->constrain_ratio = get_value();
+return 0;
 }
 
 ScaleData::ScaleData(int x, int y, ScaleThread *thread)
@@ -356,6 +362,7 @@ int ScaleData::handle_event()
 {
 	thread->scale_data = get_value();
 	thread->update_window();
+return 0;
 }
 
 
@@ -371,6 +378,7 @@ int ScaleAspectAuto::handle_event()
 {
 	thread->auto_aspect = get_value();
 	thread->update_aspect(thread->window);
+return 0;
 }
 
 
@@ -389,6 +397,7 @@ ScaleAspectW::~ScaleAspectW()
 int ScaleAspectW::handle_event()
 {
 	*output = atof(get_text());
+return 0;
 }
 
 
@@ -405,6 +414,7 @@ ScaleAspectH::~ScaleAspectH()
 int ScaleAspectH::handle_event()
 {
 	*output = atof(get_text());
+return 0;
 }
 
 
-- 
2.36.1

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to