]> git.ipfire.org Git - thirdparty/freeswitch.git/blame - build/coverity_model.c
Merge pull request #2467 from signalwire/sb14
[thirdparty/freeswitch.git] / build / coverity_model.c
CommitLineData
780797f2
MJ
1/* Coverity Scan model
2 *
3 * This is a modelling file for Coverity Scan. Modelling helps to avoid false
4 * positives.
5 *
6 * - A model file can't import any header files.
7 * - Therefore only some built-in primitives like int, char and void are
8 * available but not NULL etc.
9 * - Modelling doesn't need full structs and typedefs. Rudimentary structs
10 * and similar types are sufficient.
11 * - An uninitialised local pointer is not an error. It signifies that the
12 * variable could be either NULL or have some data.
13 *
14 * Coverity Scan doesn't pick up modifications automatically. The model file
15 * must be uploaded by an admin in the analysis.
16 *
17 * Based on:
18 * http://hg.python.org/cpython/file/tip/Misc/coverity_model.c
19 * Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
20 * 2011, 2012, 2013 Python Software Foundation; All Rights Reserved
21 *
22 */
23
24/*
25 * Useful references:
26 * https://scan.coverity.com/models
27 */
28
29typedef unsigned int switch_status_t;
30
31struct pthread_mutex_t {};
32
33struct switch_mutex
34{
35 struct pthread_mutex_t lock;
36};
37typedef struct switch_mutex switch_mutex_t;
38
39switch_status_t switch_mutex_lock(switch_mutex_t *lock)
40{
41 __coverity_recursive_lock_acquire__(&lock->lock);
42}
43
44switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
45{
46 __coverity_recursive_lock_release__(&lock->lock);
47}