Fix a some more linux/GCC specific warnings

This commit is contained in:
jp9000 2014-02-14 15:56:01 -07:00
parent 966b943d5b
commit 8b8217f68e
8 changed files with 30 additions and 10 deletions

View File

@ -236,6 +236,7 @@ void device_leavecontext(device_t device)
void gl_update(device_t device)
{
/* I don't know of anything we can do here. */
UNUSED_PARAMETER(device);
}
void device_load_swapchain(device_t device, swapchain_t swap)

View File

@ -630,8 +630,8 @@ void audio_line_output(audio_line_t line, const struct audio_data *data)
} else {
blog(LOG_DEBUG, "Bad timestamp for audio line '%s', "
"data->timestamp: %llu, "
"line->base_timestamp: %llu. This can "
"data->timestamp: "PRIu64", "
"line->base_timestamp: "PRIu64". This can "
"sometimes happen when there's a pause in "
"the threads.", line->name, data->timestamp,
line->base_timestamp);

View File

@ -15,6 +15,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <inttypes.h>
#include "media-io/format-conversion.h"
#include "util/platform.h"
#include "callback/calldata.h"
@ -389,7 +391,7 @@ static inline void reset_audio_timing(obs_source_t source, uint64_t timetamp)
static inline void handle_ts_jump(obs_source_t source, uint64_t ts,
uint64_t diff)
{
blog(LOG_DEBUG, "Timestamp for source '%s' jumped by '%lld', "
blog(LOG_DEBUG, "Timestamp for source '%s' jumped by '"PRIu64"', "
"resetting audio timing", source->name, diff);
/* if has video, ignore audio data until reset */

View File

@ -26,7 +26,7 @@
#ifdef _MSC_VER
#define FORCE_INLINE __forceinline
#else
#define FORCE_INLINE __attribute__((always_inline))
#define FORCE_INLINE inline __attribute__((always_inline))
#endif
#ifdef _MSC_VER

View File

@ -21,6 +21,7 @@
#include <assert.h>
#include <ctype.h>
#include <wchar.h>
#include <wctype.h>
#include "c99defs.h"
#include "dstr.h"
#include "bmem.h"

View File

@ -82,17 +82,21 @@ size_t os_fread_mbs(FILE *file, char **pstr)
fseeko(file, 0, SEEK_END);
size = (size_t)ftello(file);
*pstr = NULL;
if (size > 0) {
char *mbstr = bmalloc(size+1);
fseeko(file, 0, SEEK_SET);
fread(mbstr, 1, size, file);
size = fread(mbstr, 1, size, file);
if (size == 0) {
bfree(mbstr);
return 0;
}
mbstr[size] = 0;
len = os_mbs_to_utf8(mbstr, size, pstr);
bfree(mbstr);
} else {
*pstr = NULL;
}
return len;
@ -101,6 +105,7 @@ size_t os_fread_mbs(FILE *file, char **pstr)
size_t os_fread_utf8(FILE *file, char **pstr)
{
size_t size = 0;
size_t size_read;
size_t len = 0;
fseeko(file, 0, SEEK_END);
@ -113,13 +118,22 @@ size_t os_fread_utf8(FILE *file, char **pstr)
/* remove the ghastly BOM if present */
fseeko(file, 0, SEEK_SET);
fread(bom, 1, 3, file);
size_read = fread(bom, 1, 3, file);
if (size_read != 3)
return 0;
offset = (astrcmp_n(bom, "\xEF\xBB\xBF", 3) == 0) ? 3 : 0;
size -= offset;
utf8str = bmalloc(size+1);
fseeko(file, offset, SEEK_SET);
fread(utf8str, 1, size, file);
size = fread(utf8str, 1, size, file);
if (size == 0) {
bfree(utf8str);
return 0;
}
utf8str[size] = 0;
*pstr = utf8str;

View File

@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <inttypes.h>
#include <sstream>
#include <util/bmem.h>
#include <util/dstr.h>
@ -292,6 +293,6 @@ int main(int argc, char *argv[])
blog(LOG_ERROR, "%s", error);
}
blog(LOG_INFO, "Number of memory leaks: %llu", bnum_allocs());
blog(LOG_INFO, "Number of memory leaks: "PRIu64, bnum_allocs());
return ret;
}

View File

@ -20,6 +20,7 @@
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/frame.h>
struct ffmpeg_data {
AVStream *video;