summaryrefslogtreecommitdiff
path: root/camlibs/spca50x
Commit message (Collapse)AuthorAgeFilesLines
* camlib build var cleanupHans Ulrich Niedermann2022-09-011-14/+27
| | | | | | | | | | | | | | | Consistently use the same notation and formatting for all camlib Makefile-files, which uses * common $(camlib_cflags) * common $(camlib_cppflags) * common $(camlib_dependencies) * common $(camlib_ldflags) * common $(camlib_libadd) and then groups additional related definitions together, making it obvious when e.g. bar_la_LIBADD adds FOO_LIBS but bar_la_CPPFLAGS forgot to add FOO_CFLAGS.
* Factor out i18n stuff into separate i18n.h filesHans Ulrich Niedermann2021-10-253-49/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the i18n definitions into i18n.h include files: One include file each for libgphoto2 and for libgphoto2_port. This removes the complete #ifdef ENABLE_NLS # include <libintl.h> # undef _ # define _(String) dgettext (GETTEXT_PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define _(String) (String) # define N_(String) (String) #endif block (which in some occasions defines even more macros) and replaces it with a single line #include "libgphoto2/i18n.h" for camlibs and libgphoto2 itself and with #include "libgphoto2_port/i18n.h" for iolibs and libgphoto2_port itself. This gives us two central locations to change the defintions.
* Avoid accidental include file name collisionsHans Ulrich Niedermann2021-10-113-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are five libgphoto2 internal *.h include files inside the source tree's `libgphoto2/` folder. Internal means they are part of the libgphoto2 implementation, and are not part of the public libgphoto2 API or ABI. These files have names which are so generic that it is difficult to see from a `#include` statement that the included file is actually part of libgphoto2: bayer-types.h bayer.h exif.h gamma.h jpeg.h While building, an additional file is created inside the `libgphoto2/` folder with a name which does hint to its relationship with libgphoto2: gphoto2-endian.h To reduce the probability of accidental conflicts with include files which might also be called the same very generic name, this changes the use of these include files to a preprocessor directive like #include "libgphoto2/bayer.h> instead of #include "bayer.h" To enforce the need for the "libgphoto2/" part in the #include preprocessor directive, this also removes the respective `-I` arguments for the `libgphoto2` subdir (both in source tree and in build tree) from `*_CPPFLAGS`. This change was inspired by `libgphoto2/` and `camlibs/stv0680/` containing very different include files both called `bayer.h`.
* utf-8: Convert ISO-8859 text to UTF-8Hans Ulrich Niedermann2021-10-093-4/+4
| | | | | | | Convert the easy ISO-8859 text to UTF-8. The difficult ISO-8859 text will will be eliminated by future commits.
* Use consistently named non-reserved CPP macros for header filesHans Ulrich Niedermann2021-10-056-18/+21
| | | | | | | | | | | | | | | | | | | | | | | C preprocessor macros beginning/ending with underscores are reserved for system use as well as macros containing a double underscore anywhere, so application software macros are supposed to be named differently. For a header file gphoto2-abilities-list.h, this consistently uses a macro name LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H for the usual #ifndef LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H #define LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H ... content of the header file ... #endif /* !defined(LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H) */ Found using "clang -Weverything". This should work, unless when run with an ancient C preprocessor which might only the first 8 or 10 characters to distinguish macro names and ignores the remainder of the name.
* Fix byte swap calls (#626)Zeranoe2021-02-242-5/+5
| | | | gphoto2-endian.h provides shims for the standard byte swap macros, so using the standard name is preferred.
* Remove stdint.h shim (#625)Zeranoe2021-02-221-1/+1
| | | stdint.h has wide adoption at this point, so it should be safe to use.
* quieten some integher size warningsMarcus Meissner2020-10-111-1/+1
|
* fixed a condition to be correct (AFL)Marcus Meissner2020-09-071-1/+1
|
* added more length checks to avoid overflows (AFL)Marcus Meissner2020-09-061-2/+17
| | | | also added more debugging
* qindex is unsigned. maximum is 10, while we can read up to 15 (AFL)Marcus Meissner2020-09-062-2/+6
|
* Fix spca50x camlib compilation warnings.Siim Meerits2020-08-311-7/+7
| | | | | | * spca50x_get_avi(...): Cast buffer size result from pointer arithmetic to 'unsigned int' for string printing. * spca50x_sdram_get_info(...): Change 'index' variable type to signed as it is derived from and compared to signed variables. Negative 'index' values would result in segfault so the signed comparison is safe. * spca50x_get_FATs(...): Add some casts to 'unsigned int' in comparisons. This does not change behavior, but suppresses compiler warnings. Also change 'buf' variable type to 'char' as it is only used with string operations.
* Remove trailing whitespace from all *.h and *.c files.Siim Meerits2020-07-273-4/+4
|
* Fix typos throughout the codebaseSijawusz Pur Rahnama2020-05-251-1/+1
|
* return error from create_jpeg_from_dataMarcus Meissner2020-03-222-2/+3
|
* fix overflows during create_jpeg_from_data (AFL)Marcus Meissner2020-03-221-0/+3
|
* do not underread a buffer (AFL)Marcus Meissner2020-03-211-1/+1
|
* split "files" into "flash_files" and "sdram_files", as cameras might pretend ↵Marcus Meissner2020-02-294-53/+57
| | | | | | to be both and this is confusing the driver (AFL)
* spca50x: fixed a buffer overflow during yuv2rgb conversion (AFL)Marcus Meissner2020-02-241-1/+1
|
* log invaliddram and return error to avoid endless loop (AFL)Marcus Meissner2020-02-101-1/+2
|
* handle partial read files, avoid crashes (AFL)Marcus Meissner2020-02-012-1/+5
|
* handle invalid file types by erroring out (AFL)Marcus Meissner2020-01-041-0/+3
|
* initialize memory to avoid access of uninitialized memory (AFL)Marcus Meissner2020-01-042-3/+3
|
* avoid buffer overread due to mismatched total vs in fat filesize (AFL)Marcus Meissner2020-01-011-0/+5
|
* spca50x: fixed a buffer overflow (AFL)Marcus Meissner2019-12-291-1/+1
|
* fixed 2 crashes (AFL)Marcus Meissner2019-06-161-0/+6
|
* fixed crashes found during fuzzing (AFL)Marcus Meissner2019-06-163-0/+35
| | | | also on afl builds avoid sleeps
* avoid a double free (AFL)Marcus Meissner2019-05-121-0/+1
|
* replace memcpy with strcpy, otherwise we overflow callers (Coverity)Marcus Meissner2018-07-211-1/+1
|
* incremented various buffers for sprintf %0*d usage to removeMarcus Meissner2018-06-242-4/+4
| | | | | gcc warnings. Fixed strcat incorrect 3rd argument
* BSD_SOURCE -> DEFAULT_SPURCEMarcus Meissner2018-06-204-4/+4
|
* fix obvious typo in spca50x-flash.h #ifndef/#defineHans Ulrich Niedermann2016-10-291-1/+1
|
* Help editors treat as Makefiles all our Makefile-files filesHans Ulrich Niedermann2016-10-281-0/+2
|
* remove probably unistd.h include , or protected by ifdef forMarcus Meissner2016-01-033-3/+0
| | | | | | building better with Visual C https://github.com/gphoto/libgphoto2/issues/33
* fix bit operation (Coccinelle)Marcus Meissner2014-09-171-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15184 67ed7778-7388-44ab-90cf-0a291f65f57c
* removed copyright umlauts and replaced other umlautsMarcus Meissner2014-06-275-5/+5
| | | | | | | by international spelling git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15027 67ed7778-7388-44ab-90cf-0a291f65f57c
* Add <unistd.h> to files which use usleep()Daniel P. Berrange2014-06-043-0/+3
| | | | | | | | | | | | | | The usleep() function is defined to be provided by unistd.h. On Linux this is pulled in indirectly so the missing includes don't cause build problems, but on Mingw32 the explicit include of unistd.h is required. Since sleep() is not available on Mingw32, #define it to usleep(). Remove some _POSIX_C_SOURCE macros which restricted code to 1993 POSIX standard which blocks use of usleep(). git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14997 67ed7778-7388-44ab-90cf-0a291f65f57c
* cleanupMarcus Meissner2014-06-011-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14972 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: "Daniel P. Berrange" <dan@berrange.com>Marcus Meissner2014-04-114-4/+5
| | | | | | | | | Fixes to misc functions to address char * vs unsigned char * sign mis-matches, by adding casts to silence the compiler. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14902 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: "Daniel P. Berrange" <dan@berrange.com>Marcus Meissner2014-04-112-5/+5
| | | | | | | | | | | Many callers of strcpy/scanf/strcmp functions are passing a 'unsigned char *' rather than the 'char *' they expect. Add explicit casts to silence the compiler. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14901 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: "Daniel P. Berrange" <dan@berrange.com>Marcus Meissner2014-04-111-1/+1
| | | | | | | | | | Many calls of gp_file_* functions are passing a 'unsigned char *' rather than the 'char *' they expect. Add explicit casts to silence the compiler. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14900 67ed7778-7388-44ab-90cf-0a291f65f57c
* iFrom: "Daniel P. Berrange" <dan@berrange.com>Marcus Meissner2014-04-113-25/+25
| | | | | | | | | | Many calls of gp_port_* functions are passing a 'unsigned char *' rather than the 'char *' they expect. Add explicit casts to silence the compiler. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14899 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: "Daniel P. Berrange" <berrange@redhat.com>Marcus Meissner2014-04-111-3/+1
| | | | | | | | | | A great many functions have variables which are set to some value, but never read thereafter. All these variables can be removed with no functional impact. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14896 67ed7778-7388-44ab-90cf-0a291f65f57c
* updated fsf addressMarcus Meissner2014-01-017-14/+14
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14608 67ed7778-7388-44ab-90cf-0a291f65f57c
* fixed passed size to avoid overwrites (Coverity)Marcus Meissner2013-09-011-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14537 67ed7778-7388-44ab-90cf-0a291f65f57c
* add some braces to make it safer (Coverity)Marcus Meissner2013-09-011-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14535 67ed7778-7388-44ab-90cf-0a291f65f57c
* added #define _BSD_SOURCE for ansi like buildsMarcus Meissner2013-02-204-0/+7
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14248 67ed7778-7388-44ab-90cf-0a291f65f57c
* removed shadowing varsMarcus Meissner2011-02-251-4/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13548 67ed7778-7388-44ab-90cf-0a291f65f57c
* Replaced C99-style commentsDan Fandrich2010-09-151-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13311 67ed7778-7388-44ab-90cf-0a291f65f57c
* Batch commit from weekend work:Marcus Meissner2009-02-161-6/+1
| | | | | | | | | | | | | | - removed "type" from CameraFile handling: - all put_file functions and hooks get "type" as argument now - added type to the set_file_info_noop call - started removal of "name" from CameraFile - generate new filename from original filename + camerafile type + mimetype - new gp_camera_autodetect() helper function - adapted all drivers. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11818 67ed7778-7388-44ab-90cf-0a291f65f57c