Skip to content

Commit

Permalink
Solved compilation errors in VS2013
Browse files Browse the repository at this point in the history
  • Loading branch information
dani4 committed Mar 4, 2015
1 parent 56cd1c8 commit e10b5bb
Show file tree
Hide file tree
Showing 42 changed files with 229 additions and 203 deletions.
28 changes: 14 additions & 14 deletions include/zbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ extern int zbar_parse_config(const char *config_string,
/** parse a fourcc string into its encoded integer value.
* @since 0.11
*/
static inline unsigned long zbar_fourcc_parse (const char *format)
static __inline unsigned long zbar_fourcc_parse (const char *format)
{
unsigned long fourcc = 0;
if(format) {
Expand Down Expand Up @@ -846,7 +846,7 @@ extern int zbar_processor_set_config(zbar_processor_t *processor,
* @see zbar_processor_set_config()
* @since 0.4
*/
static inline int zbar_processor_parse_config (zbar_processor_t *processor,
static __inline int zbar_processor_parse_config (zbar_processor_t *processor,
const char *config_string)
{
zbar_symbol_type_t sym;
Expand Down Expand Up @@ -921,23 +921,23 @@ extern int zbar_process_image(zbar_processor_t *processor,
/** display detail for last processor error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int
static __inline int
zbar_processor_error_spew (const zbar_processor_t *processor,
int verbosity)
{
return(_zbar_error_spew(processor, verbosity));
}

/** retrieve the detail string for the last processor error. */
static inline const char*
static __inline const char*
zbar_processor_error_string (const zbar_processor_t *processor,
int verbosity)
{
return(_zbar_error_string(processor, verbosity));
}

/** retrieve the type code for the last processor error. */
static inline zbar_error_t
static __inline zbar_error_t
zbar_processor_get_error_code (const zbar_processor_t *processor)
{
return(_zbar_get_error_code(processor));
Expand Down Expand Up @@ -1043,21 +1043,21 @@ extern zbar_image_t *zbar_video_next_image(zbar_video_t *video);
/** display detail for last video error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int zbar_video_error_spew (const zbar_video_t *video,
static __inline int zbar_video_error_spew (const zbar_video_t *video,
int verbosity)
{
return(_zbar_error_spew(video, verbosity));
}

/** retrieve the detail string for the last video error. */
static inline const char *zbar_video_error_string (const zbar_video_t *video,
static __inline const char *zbar_video_error_string (const zbar_video_t *video,
int verbosity)
{
return(_zbar_error_string(video, verbosity));
}

/** retrieve the type code for the last video error. */
static inline zbar_error_t
static __inline zbar_error_t
zbar_video_get_error_code (const zbar_video_t *video)
{
return(_zbar_get_error_code(video));
Expand Down Expand Up @@ -1129,22 +1129,22 @@ extern int zbar_window_resize(zbar_window_t *window,
/** display detail for last window error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int zbar_window_error_spew (const zbar_window_t *window,
static __inline int zbar_window_error_spew (const zbar_window_t *window,
int verbosity)
{
return(_zbar_error_spew(window, verbosity));
}

/** retrieve the detail string for the last window error. */
static inline const char*
static __inline const char*
zbar_window_error_string (const zbar_window_t *window,
int verbosity)
{
return(_zbar_error_string(window, verbosity));
}

/** retrieve the type code for the last window error. */
static inline zbar_error_t
static __inline zbar_error_t
zbar_window_get_error_code (const zbar_window_t *window)
{
return(_zbar_get_error_code(window));
Expand Down Expand Up @@ -1210,7 +1210,7 @@ extern int zbar_image_scanner_set_config(zbar_image_scanner_t *scanner,
* @see zbar_image_scanner_set_config()
* @since 0.4
*/
static inline int
static __inline int
zbar_image_scanner_parse_config (zbar_image_scanner_t *scanner,
const char *config_string)
{
Expand Down Expand Up @@ -1302,7 +1302,7 @@ extern int zbar_decoder_set_config(zbar_decoder_t *decoder,
* @see zbar_decoder_set_config()
* @since 0.4
*/
static inline int zbar_decoder_parse_config (zbar_decoder_t *decoder,
static __inline int zbar_decoder_parse_config (zbar_decoder_t *decoder,
const char *config_string)
{
zbar_symbol_type_t sym;
Expand Down Expand Up @@ -1459,7 +1459,7 @@ extern zbar_symbol_type_t zbar_scan_y(zbar_scanner_t *scanner,
int y);

/** process next sample from RGB (or BGR) triple. */
static inline zbar_symbol_type_t zbar_scan_rgb24 (zbar_scanner_t *scanner,
static __inline zbar_symbol_type_t zbar_scan_rgb24 (zbar_scanner_t *scanner,
unsigned char *rgb)
{
return(zbar_scan_y(scanner, rgb[0] + rgb[1] + rgb[2]));
Expand Down
2 changes: 1 addition & 1 deletion include/zbar/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class FormatError : public Exception {
/// @internal

/// extract error information and create exception.
static inline std::exception throw_exception (const void *obj)
static __inline std::exception throw_exception (const void *obj)
{
switch(_zbar_get_error_code(obj)) {
case ZBAR_ERR_NOMEM:
Expand Down
6 changes: 3 additions & 3 deletions include/zbar/Symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,17 @@ class SymbolIterator
Symbol _sym;
};

inline SymbolIterator SymbolSet::symbol_begin () const {
__inline SymbolIterator SymbolSet::symbol_begin () const {
return(SymbolIterator(*this));
}

inline const SymbolIterator SymbolSet::symbol_end () const {
__inline const SymbolIterator SymbolSet::symbol_end () const {
return(SymbolIterator());
}

/// @relates Symbol
/// stream the string representation of a Symbol.
static inline std::ostream& operator<< (std::ostream& out,
static __inline std::ostream& operator<< (std::ostream& out,
const Symbol& sym)
{
out << sym.get_type_name() << ":" << sym.get_data();
Expand Down
27 changes: 14 additions & 13 deletions zbar/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/

#include "unistd.h"
#include "image.h"
#include "video.h"
#include "window.h"
Expand Down Expand Up @@ -172,7 +173,7 @@ static int intsort (const void *a,
#endif

/* verify that format list is in required sort order */
static inline int verify_format_sort (void)
static __inline int verify_format_sort (void)
{
int i;
for(i = 0; i < num_format_defs; i++) {
Expand Down Expand Up @@ -224,7 +225,7 @@ static inline int verify_format_sort (void)
return(-1);
}

static inline void uv_round (zbar_image_t *img,
static __inline void uv_round (zbar_image_t *img,
const zbar_format_def_t *fmt)
{
img->width >>= fmt->p.yuv.xsub2;
Expand All @@ -233,7 +234,7 @@ static inline void uv_round (zbar_image_t *img,
img->height <<= fmt->p.yuv.ysub2;
}

static inline void uv_roundup (zbar_image_t *img,
static __inline void uv_roundup (zbar_image_t *img,
const zbar_format_def_t *fmt)
{
unsigned xmask, ymask;
Expand All @@ -247,7 +248,7 @@ static inline void uv_roundup (zbar_image_t *img,
img->height = (img->height + ymask) & ~ymask;
}

static inline unsigned long uvp_size (const zbar_image_t *img,
static __inline unsigned long uvp_size (const zbar_image_t *img,
const zbar_format_def_t *fmt)
{
if(fmt->group == ZBAR_FMT_GRAY)
Expand All @@ -256,7 +257,7 @@ static inline unsigned long uvp_size (const zbar_image_t *img,
(img->height >> fmt->p.yuv.ysub2));
}

static inline uint32_t convert_read_rgb (const uint8_t *srcp,
static __inline uint32_t convert_read_rgb (const uint8_t *srcp,
int bpp)
{
uint32_t p;
Expand All @@ -274,7 +275,7 @@ static inline uint32_t convert_read_rgb (const uint8_t *srcp,
return(p);
}

static inline void convert_write_rgb (uint8_t *dstp,
static __inline void convert_write_rgb (uint8_t *dstp,
uint32_t p,
int bpp)
{
Expand All @@ -301,7 +302,7 @@ static void cleanup_ref (zbar_image_t *img)
/* resize y plane, drop extra columns/rows from the right/bottom,
* or duplicate last column/row to pad missing data
*/
static inline void convert_y_resize (zbar_image_t *dst,
static __inline void convert_y_resize (zbar_image_t *dst,
const zbar_format_def_t *dstfmt,
const zbar_image_t *src,
const zbar_format_def_t *srcfmt,
Expand Down Expand Up @@ -1045,7 +1046,7 @@ zbar_image_t *zbar_image_convert (const zbar_image_t *src,
return(zbar_image_convert_resize(src, fmt, src->width, src->height));
}

static inline int has_format (uint32_t fmt,
static __inline int has_format (uint32_t fmt,
const uint32_t *fmts)
{
for(; *fmts; fmts++)
Expand Down Expand Up @@ -1076,7 +1077,7 @@ int _zbar_best_format (uint32_t src,
if(!srcfmt)
return(-1);

zprintf(8, "from %.4s(%08" PRIx32 ") to", (char*)&src, src);
zprintf(8, "from %.4s(%08lx to", (char*)&src, src);
for(; *dsts; dsts++) {
const zbar_format_def_t *dstfmt = _zbar_format_lookup(*dsts);
int cost;
Expand All @@ -1089,7 +1090,7 @@ int _zbar_best_format (uint32_t src,
cost = conversions[srcfmt->group][dstfmt->group].cost;

if(_zbar_verbosity >= 8)
fprintf(stderr, " %.4s(%08" PRIx32 ")=%d",
fprintf(stderr, " %.4s(%08lx)=%d",
(char*)dsts, *dsts, cost);
if(cost >= 0 && min_cost > cost) {
min_cost = cost;
Expand Down Expand Up @@ -1144,11 +1145,11 @@ int zbar_negotiate_format (zbar_video_t *vdo,
continue;
cost = _zbar_best_format(*fmt, &win_fmt, dsts);
if(cost < 0) {
zprintf(4, "%.4s(%08" PRIx32 ") -> ? (unsupported)\n",
zprintf(4, "%.4s(%08lx) -> ? (unsupported)\n",
(char*)fmt, *fmt);
continue;
}
zprintf(4, "%.4s(%08" PRIx32 ") -> %.4s(%08" PRIx32 ") (%d)\n",
zprintf(4, "%.4s(%08lx) -> %.4s(%08lx) (%d)\n",
(char*)fmt, *fmt, (char*)&win_fmt, win_fmt, cost);
if(min_cost > cost) {
min_cost = cost;
Expand All @@ -1166,7 +1167,7 @@ int zbar_negotiate_format (zbar_video_t *vdo,
if(!vdo)
return(0);

zprintf(2, "setting best format %.4s(%08" PRIx32 ") (%d)\n",
zprintf(2, "setting best format %.4s(%08lx) (%d)\n",
(char*)&min_fmt, min_fmt, min_cost);
return(zbar_video_init(vdo, min_fmt));
}
6 changes: 3 additions & 3 deletions zbar/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ zbar_symbol_type_t zbar_decode_width (zbar_decoder_t *dcode,
return(sym);
}

static inline const unsigned int*
static __inline const unsigned int*
decoder_get_configp (const zbar_decoder_t *dcode,
zbar_symbol_type_t sym)
{
Expand Down Expand Up @@ -403,7 +403,7 @@ unsigned int zbar_decoder_get_configs (const zbar_decoder_t *dcode,
return(*config);
}

static inline int decoder_set_config_bool (zbar_decoder_t *dcode,
static __inline int decoder_set_config_bool (zbar_decoder_t *dcode,
zbar_symbol_type_t sym,
zbar_config_t cfg,
int val)
Expand Down Expand Up @@ -434,7 +434,7 @@ static inline int decoder_set_config_bool (zbar_decoder_t *dcode,
return(0);
}

static inline int decoder_set_config_int (zbar_decoder_t *dcode,
static __inline int decoder_set_config_int (zbar_decoder_t *dcode,
zbar_symbol_type_t sym,
zbar_config_t cfg,
int val)
Expand Down
20 changes: 10 additions & 10 deletions zbar/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ struct zbar_decoder_s {
};

/* return current element color */
static inline char get_color (const zbar_decoder_t *dcode)
static __inline char get_color (const zbar_decoder_t *dcode)
{
return(dcode->idx & 1);
}

/* retrieve i-th previous element width */
static inline unsigned get_width (const zbar_decoder_t *dcode,
static __inline unsigned get_width (const zbar_decoder_t *dcode,
unsigned char offset)
{
return(dcode->w[(dcode->idx - offset) & (DECODE_WINDOW - 1)]);
}

/* retrieve bar+space pair width starting at offset i */
static inline unsigned pair_width (const zbar_decoder_t *dcode,
static __inline unsigned pair_width (const zbar_decoder_t *dcode,
unsigned char offset)
{
return(get_width(dcode, offset) + get_width(dcode, offset + 1));
Expand All @@ -159,7 +159,7 @@ static inline unsigned pair_width (const zbar_decoder_t *dcode,
* (<= DECODE_WINDOW - n)
* - size of character is n elements
*/
static inline unsigned calc_s (const zbar_decoder_t *dcode,
static __inline unsigned calc_s (const zbar_decoder_t *dcode,
unsigned char offset,
unsigned char n)
{
Expand All @@ -180,7 +180,7 @@ static inline unsigned calc_s (const zbar_decoder_t *dcode,
* => using like-edge measurements avoids these issues
* - n should be > 3
*/
static inline int decode_e (unsigned e,
static __inline int decode_e (unsigned e,
unsigned s,
unsigned n)
{
Expand All @@ -194,7 +194,7 @@ static inline int decode_e (unsigned e,

/* sort three like-colored elements and return ordering
*/
static inline unsigned decode_sort3 (zbar_decoder_t *dcode,
static __inline unsigned decode_sort3 (zbar_decoder_t *dcode,
int i0)
{
unsigned w0 = get_width(dcode, i0);
Expand All @@ -216,7 +216,7 @@ static inline unsigned decode_sort3 (zbar_decoder_t *dcode,

/* sort N like-colored elements and return ordering
*/
static inline unsigned decode_sortn (zbar_decoder_t *dcode,
static __inline unsigned decode_sortn (zbar_decoder_t *dcode,
int n,
int i0)
{
Expand Down Expand Up @@ -244,7 +244,7 @@ static inline unsigned decode_sortn (zbar_decoder_t *dcode,
}

/* acquire shared state lock */
static inline char acquire_lock (zbar_decoder_t *dcode,
static __inline char acquire_lock (zbar_decoder_t *dcode,
zbar_symbol_type_t req)
{
if(dcode->lock) {
Expand All @@ -256,7 +256,7 @@ static inline char acquire_lock (zbar_decoder_t *dcode,
}

/* check and release shared state lock */
static inline char release_lock (zbar_decoder_t *dcode,
static __inline char release_lock (zbar_decoder_t *dcode,
zbar_symbol_type_t req)
{
zassert(dcode->lock == req, 1, "lock=%d req=%d\n",
Expand All @@ -266,7 +266,7 @@ static inline char release_lock (zbar_decoder_t *dcode,
}

/* ensure output buffer has sufficient allocation for request */
static inline char size_buf (zbar_decoder_t *dcode,
static __inline char size_buf (zbar_decoder_t *dcode,
unsigned len)
{
unsigned char *buf;
Expand Down
Loading

0 comments on commit e10b5bb

Please sign in to comment.