~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulsecore/macro.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-05 14:18:20 UTC
  • mfrom: (1.2.4 upstream) (1.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505141820-rrr2mtdd1jkllvr8
Tags: 1:0.9.15-1ubuntu1
* Merge from unreleased Debian pulseaudio git, remaining changes:
  - epoch (my stupid fault :S)
  - Don't build against, and create jack package. Jack is not in main
  - use linear resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config, also change buffer size
  - Add alsa configuration files to route alsa applications via pulseaudio
  - Move libasound2-plugins from Recommends to Depends
  - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
    daemons
  - patch to fix source/sink and suspend-on-idle race
  - Make initscript more informative in the default case of per-user
    sessions
  - create /var/run/pulse, and make restart more robust
  - add status check for system wide pulseaudio instance
  - LSB {Required-*,Should-*} should specify hal instead of dbus,
    since hal is required (and already requires dbus)
  - indicate that the system pulseaudio instance is being started from the init
    script
  - Install more upstream man pages
  - Link to pacat for parec man page
  - check whether pulseaudio is running before preloading the padsp library
  - Add DEB_OPT_FLAG = -O3 as per recommendation from
    pulseaudio-discuss/2007-December/001017.html
  - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
  - disable glitch free (use tsched=0)
  - Generate a PO template on build
  - add special case to disable pulseaudio loading if accessibility/speech
    is being used
  - the sd wrapper script should not load pulseaudio if pulseaudio is being
    used as a system service
  - add a pulseaudio apport hook
  - fix some typos in README.Debian
  - demote paprefs to suggests
  - drop padevchooser(Recommends) and pavucontrol (Suggests)
  - drop libasyncns-dev build dependency, its in universe
* add libudev-dev as a build-dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
  PulseAudio is free software; you can redistribute it and/or modify
10
10
  it under the terms of the GNU Lesser General Public License as published
11
 
  by the Free Software Foundation; either version 2 of the License,
 
11
  by the Free Software Foundation; either version 2.1 of the License,
12
12
  or (at your option) any later version.
13
13
 
14
14
  PulseAudio is distributed in the hope that it will be useful, but
164
164
 
165
165
#define pa_return_null_if_fail(expr) pa_return_val_if_fail(expr, NULL)
166
166
 
167
 
/* An assert which guarantees side effects of x, i.e. is never
168
 
 * optimized away */
 
167
/* pa_assert_se() is an assert which guarantees side effects of x,
 
168
 * i.e. is never optimized away, regardless of NDEBUG or FASTPATH. */
169
169
#define pa_assert_se(expr)                                              \
170
170
    do {                                                                \
171
171
        if (PA_UNLIKELY(!(expr))) {                                     \
174
174
        }                                                               \
175
175
    } while (FALSE)
176
176
 
177
 
/* An assert that may be optimized away by defining NDEBUG */
 
177
/* Does exactly nothing */
 
178
#define pa_nop() do {} while (FALSE)
 
179
 
 
180
/* pa_assert() is an assert that may be optimized away by defining
 
181
 * NDEBUG. pa_assert_fp() is an assert that may be optimized away by
 
182
 * defining FASTPATH. It is supposed to be used in inner loops. It's
 
183
 * there for extra paranoia checking and should probably be removed in
 
184
 * production builds. */
178
185
#ifdef NDEBUG
179
 
#define pa_assert(expr) do {} while (FALSE)
 
186
#define pa_assert(expr) pa_nop()
 
187
#define pa_assert_fp(expr) pa_nop()
 
188
#elif defined (FASTPATH)
 
189
#define pa_assert(expr) pa_assert_se(expr)
 
190
#define pa_assert_fp(expr) pa_nop()
180
191
#else
181
192
#define pa_assert(expr) pa_assert_se(expr)
 
193
#define pa_assert_fp(expr) pa_assert_se(expr)
182
194
#endif
183
195
 
 
196
#ifdef NDEBUG
 
197
#define pa_assert_not_reached() pa_nop()
 
198
#else
184
199
#define pa_assert_not_reached()                                         \
185
200
    do {                                                                \
186
201
        pa_log_error("Code should not be reached at %s:%u, function %s(). Aborting.", __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
187
202
        abort();                                                        \
188
203
    } while (FALSE)
189
 
 
190
 
#define PA_PTR_TO_UINT(p) ((unsigned int) (unsigned long) (p))
191
 
#define PA_UINT_TO_PTR(u) ((void*) (unsigned long) (u))
192
 
 
193
 
#define PA_PTR_TO_UINT32(p) ((uint32_t) PA_PTR_TO_UINT(p))
194
 
#define PA_UINT32_TO_PTR(u) PA_UINT_TO_PTR((uint32_t) u)
195
 
 
196
 
#define PA_PTR_TO_INT(p) ((int) PA_PTR_TO_UINT(p))
197
 
#define PA_INT_TO_PTR(u) PA_UINT_TO_PTR((int) u)
198
 
 
199
 
#define PA_PTR_TO_INT32(p) ((int32_t) PA_PTR_TO_UINT(p))
200
 
#define PA_INT32_TO_PTR(u) PA_UINT_TO_PTR((int32_t) u)
 
204
#endif
 
205
 
 
206
/* A compile time assertion */
 
207
#define pa_assert_cc(expr)                         \
 
208
    do {                                           \
 
209
        switch (0) {                               \
 
210
            case 0:                                \
 
211
            case !!(expr):                         \
 
212
                ;                                  \
 
213
        }                                          \
 
214
    } while (FALSE)
 
215
 
 
216
#define PA_PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
 
217
#define PA_UINT_TO_PTR(u) ((void*) ((uintptr_t) (u)))
 
218
 
 
219
#define PA_PTR_TO_UINT32(p) ((uint32_t) ((uintptr_t) (p)))
 
220
#define PA_UINT32_TO_PTR(u) ((void*) ((uintptr_t) (u)))
 
221
 
 
222
#define PA_PTR_TO_INT(p) ((int) ((intptr_t) (p)))
 
223
#define PA_INT_TO_PTR(u) ((void*) ((intptr_t) (u)))
 
224
 
 
225
#define PA_PTR_TO_INT32(p) ((int32_t) ((intptr_t) (p)))
 
226
#define PA_INT32_TO_PTR(u) ((void*) ((intptr_t) (u)))
201
227
 
202
228
#ifdef OS_IS_WIN32
203
229
#define PA_PATH_SEP "\\"