Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pipewire pipewire
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 580
    • Issues 580
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PipeWirePipeWire
  • pipewirepipewire
  • Issues
  • #197
Closed
Open
Issue created Dec 11, 2019 by George Kiagiadakis@gkiagiaOwner

internal variables in macros should use private names

this sets the volume to 0.0:

float f = 1.0;
const struct spa_pod *param = spa_pod_builder_add_object (&b,
            SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
            SPA_PROP_volume, SPA_POD_Float(f));

this sets the volume to 1.0:

float vol = 1.0;
const struct spa_pod *param = spa_pod_builder_add_object (&b,
            SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
            SPA_PROP_volume, SPA_POD_Float(vol));

guess why ...

#define spa_pod_builder_add_object(b,type,id,...)				\
({										\
	struct spa_pod_frame f;							\
	spa_pod_builder_push_object(b, &f, type, id);				\
	spa_pod_builder_add(b, ##__VA_ARGS__, 0);				\
	spa_pod_builder_pop(b, &f);						\
})

it took me a while :/

Assignee
Assign to
Time tracking