find . -regex '.*\.\(cpp\|hpp\|cu\|c\|h\)' -exec clang-format --verbose --style=file -i {} \;
This commit is contained in:
parent
89b1a6777b
commit
f0b3ab2324
@ -14,7 +14,7 @@ find_file(HAVE_FEATURES_H "features.h" DOC "features.h exists")
|
||||
find_file(HAVE_POLL_H "poll.h" DOC "poll.h exists")
|
||||
find_file(HAVE_SYS_TIME_H "sys/time.h" DOC "sys/time.h exists")
|
||||
|
||||
add_library(zbar
|
||||
add_library(zbar SHARED
|
||||
zbar/decoder/qr_finder.c
|
||||
zbar/qrcode/qrdec.c
|
||||
zbar/qrcode/qrdectxt.c
|
||||
@ -69,7 +69,6 @@ target_compile_definitions(zbar
|
||||
ENABLE_QRCODE
|
||||
ZBAR_VERSION_MAJOR=0
|
||||
ZBAR_VERSION_MINOR=23
|
||||
ZBAR_VERSION_PATCH=0
|
||||
)
|
||||
|
||||
if (HAVE_INTTYPES_H)
|
||||
|
||||
@ -87,7 +87,7 @@ gboolean zbar_gtk_image_from_pixbuf(zbar_image_t *zimg, GdkPixbuf *pixbuf)
|
||||
|
||||
nchannels = gdk_pixbuf_get_n_channels(pixbuf);
|
||||
bps = gdk_pixbuf_get_bits_per_sample(pixbuf);
|
||||
type = 0;
|
||||
type = 0;
|
||||
|
||||
/* these are all guesses... */
|
||||
if (nchannels == 3 && bps == 8)
|
||||
@ -253,7 +253,7 @@ static gboolean zbar_processing_idle_callback(gpointer data)
|
||||
{
|
||||
ZBarGtk *self = data;
|
||||
ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private);
|
||||
GValue *msg = g_async_queue_try_pop(zbar->queue);
|
||||
GValue *msg = g_async_queue_try_pop(zbar->queue);
|
||||
GType type;
|
||||
|
||||
if (!msg) {
|
||||
@ -302,7 +302,7 @@ static gboolean zbar_processing_idle_callback(gpointer data)
|
||||
zbar->video_enabled_state = (state != 0);
|
||||
} else if (type == G_TYPE_STRING) {
|
||||
/* open new video device */
|
||||
const char *video_device = g_value_get_string(msg);
|
||||
const char *video_device = g_value_get_string(msg);
|
||||
|
||||
zbar->video_enabled_state = zbar_gtk_video_open(self, video_device);
|
||||
} else if (type == GDK_TYPE_PIXBUF) {
|
||||
@ -460,7 +460,7 @@ static void zbar_get_preferred_width(GtkWidget *widget, gint *minimum_width,
|
||||
|
||||
screen_width = geo.width;
|
||||
#else
|
||||
screen_width = gdk_screen_width();
|
||||
screen_width = gdk_screen_width();
|
||||
#endif
|
||||
|
||||
if (zbar->req_width > screen_width) {
|
||||
|
||||
@ -262,9 +262,9 @@ public:
|
||||
/// @since 0.4
|
||||
Image convert(unsigned long format, unsigned width, unsigned height) const
|
||||
{
|
||||
zbar_image_t *img;
|
||||
zbar_image_t *img;
|
||||
|
||||
img = zbar_image_convert_resize(_img, format, width, height);
|
||||
img = zbar_image_convert_resize(_img, format, width, height);
|
||||
if (img)
|
||||
return (Image(img));
|
||||
throw FormatError();
|
||||
|
||||
@ -349,12 +349,12 @@ PyTypeObject zbarDecoder_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = decoder_doc,
|
||||
.tp_basicsize = sizeof(zbarDecoder),
|
||||
.tp_new = (newfunc)decoder_new,
|
||||
.tp_traverse = (traverseproc)decoder_traverse,
|
||||
.tp_clear = (inquiry)decoder_clear,
|
||||
.tp_dealloc = (destructor)decoder_dealloc,
|
||||
.tp_getset = decoder_getset,
|
||||
.tp_methods = decoder_methods,
|
||||
.tp_doc = decoder_doc,
|
||||
.tp_basicsize = sizeof(zbarDecoder),
|
||||
.tp_new = (newfunc)decoder_new,
|
||||
.tp_traverse = (traverseproc)decoder_traverse,
|
||||
.tp_clear = (inquiry)decoder_clear,
|
||||
.tp_dealloc = (destructor)decoder_dealloc,
|
||||
.tp_getset = decoder_getset,
|
||||
.tp_methods = decoder_methods,
|
||||
};
|
||||
|
||||
@ -179,8 +179,8 @@ PyTypeObject zbarEnum_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = enum_doc,
|
||||
.tp_basicsize = sizeof(zbarEnum),
|
||||
.tp_doc = enum_doc,
|
||||
.tp_basicsize = sizeof(zbarEnum),
|
||||
.tp_dictoffset = offsetof(zbarEnum, byname),
|
||||
.tp_traverse = (traverseproc)enum_traverse,
|
||||
.tp_clear = (inquiry)enum_clear,
|
||||
|
||||
@ -111,13 +111,13 @@ PyTypeObject zbarException_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_basicsize = sizeof(zbarException),
|
||||
.tp_init = (initproc)exc_init,
|
||||
.tp_traverse = (traverseproc)exc_traverse,
|
||||
.tp_clear = (inquiry)exc_clear,
|
||||
.tp_dealloc = (destructor)exc_dealloc,
|
||||
.tp_str = (reprfunc)exc_str,
|
||||
.tp_getset = exc_getset,
|
||||
.tp_basicsize = sizeof(zbarException),
|
||||
.tp_init = (initproc)exc_init,
|
||||
.tp_traverse = (traverseproc)exc_traverse,
|
||||
.tp_clear = (inquiry)exc_clear,
|
||||
.tp_dealloc = (destructor)exc_dealloc,
|
||||
.tp_str = (reprfunc)exc_str,
|
||||
.tp_getset = exc_getset,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -446,16 +446,16 @@ PyTypeObject zbarImage_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = image_doc,
|
||||
.tp_basicsize = sizeof(zbarImage),
|
||||
.tp_new = (newfunc)image_new,
|
||||
.tp_init = (initproc)image_init,
|
||||
.tp_traverse = (traverseproc)image_traverse,
|
||||
.tp_clear = (inquiry)image_clear,
|
||||
.tp_dealloc = (destructor)image_dealloc,
|
||||
.tp_getset = image_getset,
|
||||
.tp_methods = image_methods,
|
||||
.tp_iter = (getiterfunc)image_iter,
|
||||
.tp_doc = image_doc,
|
||||
.tp_basicsize = sizeof(zbarImage),
|
||||
.tp_new = (newfunc)image_new,
|
||||
.tp_init = (initproc)image_init,
|
||||
.tp_traverse = (traverseproc)image_traverse,
|
||||
.tp_clear = (inquiry)image_clear,
|
||||
.tp_dealloc = (destructor)image_dealloc,
|
||||
.tp_getset = image_getset,
|
||||
.tp_methods = image_methods,
|
||||
.tp_iter = (getiterfunc)image_iter,
|
||||
};
|
||||
|
||||
zbarImage *zbarImage_FromImage(zbar_image_t *zimg)
|
||||
|
||||
@ -186,10 +186,10 @@ PyTypeObject zbarImageScanner_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
|
||||
|
||||
.tp_doc = imagescanner_doc,
|
||||
.tp_basicsize = sizeof(zbarImageScanner),
|
||||
.tp_new = (newfunc)imagescanner_new,
|
||||
.tp_dealloc = (destructor)imagescanner_dealloc,
|
||||
.tp_getset = imagescanner_getset,
|
||||
.tp_methods = imagescanner_methods,
|
||||
.tp_doc = imagescanner_doc,
|
||||
.tp_basicsize = sizeof(zbarImageScanner),
|
||||
.tp_new = (newfunc)imagescanner_new,
|
||||
.tp_dealloc = (destructor)imagescanner_dealloc,
|
||||
.tp_getset = imagescanner_getset,
|
||||
.tp_methods = imagescanner_methods,
|
||||
};
|
||||
|
||||
@ -258,7 +258,7 @@ static PyObject *processor_user_wait(zbarProcessor *self, PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int timeout = -1;
|
||||
int rc = -1;
|
||||
int rc = -1;
|
||||
static char *kwlist[] = { "timeout", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist,
|
||||
@ -280,7 +280,7 @@ static PyObject *processor_process_one(zbarProcessor *self, PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
int timeout = -1;
|
||||
int rc = -1;
|
||||
int rc = -1;
|
||||
static char *kwlist[] = { "timeout", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist,
|
||||
@ -445,12 +445,12 @@ PyTypeObject zbarProcessor_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = processor_doc,
|
||||
.tp_basicsize = sizeof(zbarProcessor),
|
||||
.tp_new = (newfunc)processor_new,
|
||||
.tp_traverse = (traverseproc)processor_traverse,
|
||||
.tp_clear = (inquiry)processor_clear,
|
||||
.tp_dealloc = (destructor)processor_dealloc,
|
||||
.tp_getset = processor_getset,
|
||||
.tp_methods = processor_methods,
|
||||
.tp_doc = processor_doc,
|
||||
.tp_basicsize = sizeof(zbarProcessor),
|
||||
.tp_new = (newfunc)processor_new,
|
||||
.tp_traverse = (traverseproc)processor_traverse,
|
||||
.tp_clear = (inquiry)processor_clear,
|
||||
.tp_dealloc = (destructor)processor_dealloc,
|
||||
.tp_getset = processor_getset,
|
||||
.tp_methods = processor_methods,
|
||||
};
|
||||
|
||||
@ -182,12 +182,12 @@ PyTypeObject zbarScanner_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = scanner_doc,
|
||||
.tp_basicsize = sizeof(zbarScanner),
|
||||
.tp_new = (newfunc)scanner_new,
|
||||
.tp_traverse = (traverseproc)scanner_traverse,
|
||||
.tp_clear = (inquiry)scanner_clear,
|
||||
.tp_dealloc = (destructor)scanner_dealloc,
|
||||
.tp_getset = scanner_getset,
|
||||
.tp_methods = scanner_methods,
|
||||
.tp_doc = scanner_doc,
|
||||
.tp_basicsize = sizeof(zbarScanner),
|
||||
.tp_new = (newfunc)scanner_new,
|
||||
.tp_traverse = (traverseproc)scanner_traverse,
|
||||
.tp_clear = (inquiry)scanner_clear,
|
||||
.tp_dealloc = (destructor)scanner_dealloc,
|
||||
.tp_getset = scanner_getset,
|
||||
.tp_methods = scanner_methods,
|
||||
};
|
||||
|
||||
@ -189,13 +189,13 @@ PyTypeObject zbarSymbol_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = symbol_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbol),
|
||||
.tp_traverse = (traverseproc)symbol_traverse,
|
||||
.tp_clear = (inquiry)symbol_clear,
|
||||
.tp_dealloc = (destructor)symbol_dealloc,
|
||||
.tp_iter = (getiterfunc)symbol_iter,
|
||||
.tp_getset = symbol_getset,
|
||||
.tp_doc = symbol_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbol),
|
||||
.tp_traverse = (traverseproc)symbol_traverse,
|
||||
.tp_clear = (inquiry)symbol_clear,
|
||||
.tp_dealloc = (destructor)symbol_dealloc,
|
||||
.tp_iter = (getiterfunc)symbol_iter,
|
||||
.tp_getset = symbol_getset,
|
||||
};
|
||||
|
||||
zbarSymbol *zbarSymbol_FromSymbol(const zbar_symbol_t *zsym)
|
||||
|
||||
@ -80,13 +80,13 @@ PyTypeObject zbarSymbolIter_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
|
||||
.tp_doc = symboliter_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbolIter),
|
||||
.tp_traverse = (traverseproc)symboliter_traverse,
|
||||
.tp_clear = (inquiry)symboliter_clear,
|
||||
.tp_dealloc = (destructor)symboliter_dealloc,
|
||||
.tp_iter = (getiterfunc)symboliter_iter,
|
||||
.tp_iternext = (iternextfunc)symboliter_iternext,
|
||||
.tp_doc = symboliter_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbolIter),
|
||||
.tp_traverse = (traverseproc)symboliter_traverse,
|
||||
.tp_clear = (inquiry)symboliter_clear,
|
||||
.tp_dealloc = (destructor)symboliter_dealloc,
|
||||
.tp_iter = (getiterfunc)symboliter_iter,
|
||||
.tp_iternext = (iternextfunc)symboliter_iternext,
|
||||
};
|
||||
|
||||
zbarSymbolIter *zbarSymbolIter_FromSymbolSet(zbarSymbolSet *syms)
|
||||
|
||||
@ -64,8 +64,8 @@ PyTypeObject zbarSymbolSet_Type = {
|
||||
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
|
||||
|
||||
.tp_doc = symbolset_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbolSet),
|
||||
.tp_doc = symbolset_doc,
|
||||
.tp_basicsize = sizeof(zbarSymbolSet),
|
||||
.tp_dealloc = (destructor)symbolset_dealloc,
|
||||
.tp_iter = (getiterfunc)symbolset_iter,
|
||||
.tp_as_sequence = &symbolset_as_sequence,
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
GNU Lesser General Public License as published by the Free Software
|
||||
Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
version.*/
|
||||
#include "qrdec.h"
|
||||
#include "config.h"
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
@ -14,7 +15,6 @@
|
||||
#include "image.h"
|
||||
#include "isaac.h"
|
||||
#include "qrcode.h"
|
||||
#include "qrdec.h"
|
||||
#include "rs.h"
|
||||
#include "svg.h"
|
||||
#include "util.h"
|
||||
|
||||
@ -1218,9 +1218,11 @@ int _zbar_v4l2_probe(zbar_video_t *vdo)
|
||||
vdo->iomode = VIDEO_READWRITE;
|
||||
|
||||
zprintf(1, "using I/O mode: %s\n",
|
||||
(vdo->iomode == VIDEO_READWRITE) ? "READWRITE" :
|
||||
(vdo->iomode == VIDEO_MMAP) ? "MMAP" :
|
||||
(vdo->iomode == VIDEO_USERPTR) ? "USERPTR" : "<UNKNOWN>");
|
||||
(vdo->iomode == VIDEO_READWRITE) ?
|
||||
"READWRITE" :
|
||||
(vdo->iomode == VIDEO_MMAP) ?
|
||||
"MMAP" :
|
||||
(vdo->iomode == VIDEO_USERPTR) ? "USERPTR" : "<UNKNOWN>");
|
||||
|
||||
vdo->intf = VIDEO_V4L2;
|
||||
vdo->init = v4l2_init;
|
||||
|
||||
@ -24,7 +24,8 @@
|
||||
#include <vfw.h>
|
||||
#include "window.h"
|
||||
|
||||
extern int _zbar_window_bih_init(struct zbar_window_s *w, struct zbar_image_s *img);
|
||||
extern int _zbar_window_bih_init(struct zbar_window_s *w,
|
||||
struct zbar_image_s *img);
|
||||
|
||||
static int vfw_cleanup(zbar_window_t *w)
|
||||
{
|
||||
|
||||
@ -43,6 +43,7 @@ struct window_state_s {
|
||||
struct zbar_window_s;
|
||||
struct zbar_image_s;
|
||||
|
||||
extern int _zbar_window_bih_init(struct zbar_window_s *w, struct zbar_image_s *img);
|
||||
extern int _zbar_window_bih_init(struct zbar_window_s *w,
|
||||
struct zbar_image_s *img);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user