Fix bison 2.6 and clang warnings

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-07-20 12:48:13 +03:00
parent db98696d0b
commit 2fc0ad5001
5 changed files with 11 additions and 4 deletions

View File

@ -293,7 +293,7 @@ list_replace(struct list *old, struct list *new)
#define __container_of(ptr, sample, member) \
(void *)((char *)(ptr) \
- ((char *)&(sample)->member - (char *)(sample)))
- offsetof(__typeof(*sample), member))
/**
* Loop through the list given by head and set pos to struct in the list.
*

View File

@ -28,6 +28,8 @@
#include "xkbcomp-priv.h"
#include "parseutils.h"
#pragma GCC diagnostic ignored "-Wredundant-decls"
extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner);
#define scanner param->scanner

View File

@ -30,7 +30,6 @@
#include <stdio.h>
#include "xkbcomp-priv.h"
#include "parser.h"
struct parser_param {
struct xkb_context *ctx;
@ -38,6 +37,8 @@ struct parser_param {
XkbFile *rtrn;
};
#include "parser.h"
struct scanner_extra {
char *scanFile;
char scanBuf[1024];

View File

@ -30,6 +30,9 @@
#include "xkbcomp-priv.h"
#include "parseutils.h"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
extern int yyparse(struct parser_param *param);
#define YY_USER_ACTION { \

View File

@ -824,7 +824,8 @@ AddSymbolsToKey(KeyInfo *keyi, struct xkb_keymap *keymap,
{
xkb_group_index_t ndx;
size_t nSyms, nLevels;
size_t i, j;
size_t i;
int j;
if (!GetGroupIndex(keyi, keymap, arrayNdx, SYMBOLS, &ndx))
return false;
@ -1544,7 +1545,7 @@ PrepareKeyDef(KeyInfo *keyi)
defined = keyi->symsDefined | keyi->actsDefined | keyi->typesDefined;
/* get highest group number */
for (i = XkbNumKbdGroups - 1; i >= 0; i--) {
for (i = XkbNumKbdGroups - 1; i > 0; i--) {
if (defined & (1 << i))
break;
}