Skip to content

Commit 5e89b60

Browse files
committed
Fixed some Intel C Compiler warnings
Note that only GCC-compatible ICC mode can be used (see Mantis bug #177)
1 parent 12f481b commit 5e89b60

File tree

24 files changed

+152
-139
lines changed

24 files changed

+152
-139
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ case "$host_os" in
372372
# -fpermissive, but not in conjunction with -Werror since warnings are still
373373
# generated. Could pull local headers through:
374374
# 's/^\(extern\) \([[A-Za-z0-9]]*($\)/\1 int \2/'
375-
if test $x11_cv_broken_headers = yes -a $GCC = "yes" ; then
375+
if test $x11_cv_broken_headers = yes -a "$GCC" = "yes" ; then
376376
SAVED_X_CFLAGS=$X_CFLAGS
377377
X_CFLAGS=`echo $X_CFLAGS | sed 's%-I%-istdinc%'`
378378
AC_CACHE_CHECK(whether -istdinc fixes X11 headers, x11_cv_gcc_istdinc_works, [

dxt_compress/dxt_encoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ struct dxt_encoder
132132
#endif
133133
};
134134

135-
int dxt_prepare_yuv422_shader(struct dxt_encoder *encoder);
135+
static int dxt_prepare_yuv422_shader(struct dxt_encoder *encoder);
136136

137-
int dxt_prepare_yuv422_shader(struct dxt_encoder *encoder) {
137+
static int dxt_prepare_yuv422_shader(struct dxt_encoder *encoder) {
138138
encoder->yuv422_to_444_fp = 0;
139139
if(encoder->legacy) {
140140
encoder->yuv422_to_444_fp = dxt_shader_create_from_source(fp_yuv422_to_yuv_444_legacy, GL_FRAGMENT_SHADER);

dxt_compress/dxt_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ extern void glutMainLoopEvent(void);
5555

5656
static inline int dxt_get_size(int width, int height, enum dxt_type format)
5757
{
58+
assert( format == DXT_TYPE_DXT5_YCOCG || format == DXT_TYPE_DXT1 || format == DXT_TYPE_DXT1_YUV );
59+
5860
if ( format == DXT_TYPE_DXT5_YCOCG )
5961
return ((width + 3) / 4 * 4) * ((height + 3) / 4 * 4);
60-
else if ( format == DXT_TYPE_DXT1 || format == DXT_TYPE_DXT1_YUV )
61-
return ((width + 3) / 4 * 4) * ((height + 3) / 4 * 4) / 2;
6262
else
63-
abort();
63+
return ((width + 3) / 4 * 4) * ((height + 3) / 4 * 4) / 2;
6464
}
6565

6666
/**

src/audio/audio.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ struct state_audio {
114114
*
115115
* Input and output data may overlap.
116116
*/
117-
void copy_channel(char *out, const char *in, int bps, int in_len /* bytes */, int out_channel_count);
118-
119117
typedef void (*audio_device_help_t)(void);
120118

121119
static void *audio_sender_thread(void *arg);

src/audio/capture/alsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#ifdef HAVE_ALSA
5353

5454
#include "audio/audio.h"
55+
#include "audio/playback/alsa.h"
5556
#include "audio/utils.h"
5657

5758
#include "audio/capture/alsa.h"
@@ -72,7 +73,6 @@ struct state_alsa_capture {
7273
unsigned int min_device_channels;
7374
};
7475

75-
void audio_play_alsa_help(const char *driver_name);
7676
void audio_cap_alsa_help(const char *driver_name)
7777
{
7878
audio_play_alsa_help(driver_name);

src/audio/playback/portaudio.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ enum audio_device_kind {
8383
*/
8484

8585
/* prototyping */
86-
void portaudio_decode_frame(void *dst, void *src, int data_len, int buffer_len, void *state);
8786
static void print_device_info(PaDeviceIndex device);
8887
static int portaudio_start_stream(PaStream *stream);
8988
static void portaudio_close(PaStream *stream); /* closes and frees all audio resources ( according to valgrind this is not true.. ) */
9089
static void portaudio_print_available_devices(enum audio_device_kind);
91-
void free_audio_frame(audio_frame *buffer);
9290

9391
/*
9492
* Shared functions

src/glx_common.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ void *glx_init(glx_opengl_version_t version)
222222
};
223223

224224
int glx_major, glx_minor;
225+
226+
int fbcount;
227+
int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
228+
GLXFBConfig *fbc;
229+
GLXFBConfig bestFbc;
230+
XVisualInfo *vi;
231+
const char *glxExts;
232+
glXCreateContextAttribsARBProc glXCreateContextAttribsARB;
233+
int (*oldHandler)(Display*, XErrorEvent*);
225234

226235
// FBConfigs were added in GLX version 1.3.
227236
if ( !glXQueryVersion( display, &glx_major, &glx_minor ) ||
@@ -232,8 +241,7 @@ void *glx_init(glx_opengl_version_t version)
232241
}
233242

234243
printf( "Getting matching framebuffer configs\n" );
235-
int fbcount;
236-
GLXFBConfig *fbc = glXChooseFBConfig( display, DefaultScreen( display ),
244+
fbc = glXChooseFBConfig( display, DefaultScreen( display ),
237245
visual_attribs, &fbcount );
238246
if ( !fbc )
239247
{
@@ -244,10 +252,8 @@ void *glx_init(glx_opengl_version_t version)
244252

245253
// Pick the FB config/visual with the most samples per pixel
246254
printf( "Getting XVisualInfos\n" );
247-
int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
248255

249-
int i;
250-
for ( i = 0; i < fbcount; i++ )
256+
for ( int i = 0; i < fbcount; i++ )
251257
{
252258
XVisualInfo *vi = glXGetVisualFromFBConfig( display, fbc[i] );
253259
if ( vi )
@@ -268,13 +274,13 @@ void *glx_init(glx_opengl_version_t version)
268274
XFree( vi );
269275
}
270276

271-
GLXFBConfig bestFbc = fbc[ best_fbc ];
277+
bestFbc = fbc[ best_fbc ];
272278

273279
// Be sure to free the FBConfig list allocated by glXChooseFBConfig()
274280
XFree( fbc );
275281

276282
// Get a visual
277-
XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc );
283+
vi = glXGetVisualFromFBConfig( display, bestFbc );
278284
printf( "Chosen visual ID = 0x%x\n", (unsigned int) vi->visualid );
279285

280286
printf( "Creating colormap\n" );
@@ -309,12 +315,12 @@ void *glx_init(glx_opengl_version_t version)
309315
XMapWindow( display, win );*/
310316

311317
// Get the default screen's GLX extension list
312-
const char *glxExts = glXQueryExtensionsString( display,
318+
glxExts = glXQueryExtensionsString( display,
313319
DefaultScreen( display ) );
314320

315321
// NOTE: It is not necessary to create or make current to a context before
316322
// calling glXGetProcAddressARB
317-
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
323+
glXCreateContextAttribsARB = 0;
318324
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
319325
glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
320326

@@ -327,8 +333,7 @@ void *glx_init(glx_opengl_version_t version)
327333
// of a process use the same error handler, so be sure to guard against other
328334
// threads issuing X commands while this code is running.
329335
ctxErrorOccurred = FALSE;
330-
int (*oldHandler)(Display*, XErrorEvent*) =
331-
XSetErrorHandler(&ctxErrorHandler);
336+
oldHandler = XSetErrorHandler(&ctxErrorHandler);
332337

333338
// Check for the GLX_ARB_create_context extension string and the function.
334339
// If either is not present, use GLX 1.3 context creation method.

src/host.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ extern unsigned int audio_capture_channels;
6565

6666
extern unsigned int cuda_device;
6767

68+
// for aggregate.c
69+
struct display *initialize_video_display(const char *requested_display,
70+
char *fmt, unsigned int flags);
71+
struct vidcap *initialize_video_capture(const char *requested_capture,
72+
char *fmt, unsigned int flags);
6873
#endif

src/ihdtv/ihdtv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
#include "ihdtv.h"
6767
#include "debug.h"
6868

69-
void init_reciever(void);
70-
7169
int
7270
ihdtv_init_rx_session(ihdtv_connection * connection, const char *address_1,
7371
const char *address_2, unsigned int port1,

src/main.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include "config_win32.h"
6262
#endif // HAVE_CONFIG_H
6363
#include "debug.h"
64+
#include "host.h"
6465
#include "perf.h"
6566
#include "rtp/decoders.h"
6667
#include "rtp/rtp.h"
@@ -179,12 +180,8 @@ static struct rtp **initialize_network(char *addrs, int recv_port_base,
179180
int send_port_base, struct pdb *participants, bool use_ipv6,
180181
char *mcast_if);
181182

182-
void list_video_display_devices(void);
183-
void list_video_capture_devices(void);
184-
struct display *initialize_video_display(const char *requested_display,
185-
char *fmt, unsigned int flags);
186-
struct vidcap *initialize_video_capture(const char *requested_capture,
187-
char *fmt, unsigned int flags);
183+
static void list_video_display_devices(void);
184+
static void list_video_capture_devices(void);
188185
static void sender_finish(struct state_uv *uv);
189186
static void display_buf_increase_warning(int size);
190187

@@ -197,9 +194,9 @@ static void signal_handler(int signal)
197194
}
198195
#endif /* WIN32 */
199196

200-
void _exit_uv(int status);
197+
static void _exit_uv(int status);
201198

202-
void _exit_uv(int status) {
199+
static void _exit_uv(int status) {
203200
exit_status = status;
204201
wait_to_finish = TRUE;
205202
should_exit = TRUE;
@@ -299,7 +296,7 @@ static void usage(void)
299296
printf("\n");
300297
}
301298

302-
void list_video_display_devices()
299+
static void list_video_display_devices()
303300
{
304301
int i;
305302
display_type_t *dt;
@@ -353,7 +350,7 @@ struct display *initialize_video_display(const char *requested_display,
353350
return d;
354351
}
355352

356-
void list_video_capture_devices()
353+
static void list_video_capture_devices()
357354
{
358355
int i;
359356
struct vidcap_type *vt;

0 commit comments

Comments
 (0)