mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	treewide: mark things static and const
				
					
				
			Mark some structures, arrays static/const at various places. In some cases this prevents unnecessary initialization when a function is entered. All in all, the text segments across all shared libraries are reduced by about 2 KiB. However, the total size increases by about 2 KiB as well.
This commit is contained in:
		
							parent
							
								
									48dbb4da3c
								
							
						
					
					
						commit
						f5d51162c4
					
				
					 54 changed files with 303 additions and 241 deletions
				
			
		| 
						 | 
				
			
			@ -722,20 +722,21 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
 | 
			
		|||
 | 
			
		||||
static void emit_node_info(struct impl *this, bool full)
 | 
			
		||||
{
 | 
			
		||||
	bool is_ag = this->transport && (this->transport->profile & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY);
 | 
			
		||||
	char latency[64] = "128/8000";
 | 
			
		||||
	struct spa_dict_item ag_node_info_items[] = {
 | 
			
		||||
		{ SPA_KEY_DEVICE_API, "bluez5" },
 | 
			
		||||
		{ SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" },
 | 
			
		||||
		{ SPA_KEY_NODE_LATENCY, latency },
 | 
			
		||||
		{ "media.name", ((this->transport && this->transport->device->name) ?
 | 
			
		||||
		                 this->transport->device->name : "HSP/HFP") },
 | 
			
		||||
	};
 | 
			
		||||
	struct spa_dict_item hu_node_info_items[] = {
 | 
			
		||||
	static const struct spa_dict_item hu_node_info_items[] = {
 | 
			
		||||
		{ SPA_KEY_DEVICE_API, "bluez5" },
 | 
			
		||||
		{ SPA_KEY_MEDIA_CLASS, "Audio/Source" },
 | 
			
		||||
		{ SPA_KEY_NODE_DRIVER, "true" },
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	char latency[64] = "128/8000";
 | 
			
		||||
	const struct spa_dict_item ag_node_info_items[] = {
 | 
			
		||||
		{ SPA_KEY_DEVICE_API, "bluez5" },
 | 
			
		||||
		{ SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" },
 | 
			
		||||
		{ SPA_KEY_NODE_LATENCY, latency },
 | 
			
		||||
		{ "media.name", ((this->transport && this->transport->device->name) ?
 | 
			
		||||
					this->transport->device->name : "HSP/HFP") },
 | 
			
		||||
	};
 | 
			
		||||
	bool is_ag = this->transport && (this->transport->profile & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY);
 | 
			
		||||
	uint64_t old = full ? this->info.change_mask : 0;
 | 
			
		||||
 | 
			
		||||
	if (full)
 | 
			
		||||
| 
						 | 
				
			
			@ -1372,7 +1373,7 @@ static const struct spa_dict_item info_items[] = {
 | 
			
		|||
 | 
			
		||||
static const struct spa_dict info = SPA_DICT_INIT_ARRAY(info_items);
 | 
			
		||||
 | 
			
		||||
struct spa_handle_factory spa_sco_source_factory = {
 | 
			
		||||
const struct spa_handle_factory spa_sco_source_factory = {
 | 
			
		||||
	SPA_VERSION_HANDLE_FACTORY,
 | 
			
		||||
	SPA_NAME_API_BLUEZ5_SCO_SOURCE,
 | 
			
		||||
	&info,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue