Commit Graph

37 Commits

Author SHA1 Message Date
axxel
f41df32817 fix white-space and indentation inconsistencies (second round)
This is basically a continuation of the work from #1002 but her for the
camlibs directory. The purpose was to replace spaces as a means for
indentation with tab characters.

Note: there are some files which are still offending the general
rule but are (mostly) consistent within themselves. I let them be for
the moment. Fixing them would basically replace the whole file.

Also: there are still a ton of whitespace related inconsistencies like
"x=10" vs "x = 10" or "func(10)" vs "func (10)".

This is a whitespace only change (if you include newlines as whitespace).
2024-09-15 10:53:41 +02:00
Colin Leroy-Mira
cd9230b6d5 Fix build on Mac OS X (#953)
* Fix build on Mac OS X

Fixes #952

* Fix FreeBSD build

Include unistd.h in every file calling usleep()
2024-01-12 10:38:56 +01:00
luzpaz
dfde313175 Fix various typos in the codebase (#923)
* Fix various typos

Found via `codespell -q 3 -S "*.po" -L clen,donn,informations,udo`

* Fix typos in camlibs/

* Fix typos in ChangeLog
2023-09-03 17:04:21 +02:00
Hans Ulrich Niedermann
0b2b6207c2 Factor out i18n stuff into separate i18n.h files
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.
2021-10-25 00:20:21 +02:00
Siim Meerits
456a1d598b Remove trailing whitespace from all *.h and *.c files. 2020-07-27 17:37:00 +03:00
Sijawusz Pur Rahnama
fd0be84db5 Fix typos throughout the codebase 2020-05-25 17:55:09 +02:00
Marcus Meissner
6edef636e5 import typo fixes (in debug messages) from Debian 2017-08-29 21:30:19 +02:00
Marcus Meissner
14aab4929c remove probably unistd.h include , or protected by ifdef for
building better with Visual C

https://github.com/gphoto/libgphoto2/issues/33
2016-01-03 18:25:33 +01:00
Marcus Meissner
bf01386901 added license/copyright header
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15364 67ed7778-7388-44ab-90cf-0a291f65f57c
2015-02-22 08:20:13 +00:00
Marcus Meissner
422c674803 fixed 0 / NULL confusion, cleaned up NULL check of context (Coccinelle)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15187 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-09-21 12:56:15 +00:00
Daniel P. Berrange
5bc858cd44 Add <unistd.h> to files which use usleep()
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
2014-06-04 18:13:43 +00:00
Daniel P. Berrange
00953fd2d4 Remove mostly unused GP_SYSTEM_SLEEP macro
The GP_SYSTEM_SLEEP macro is only used in a small portion of
the codebase. Replace it with normal POSIX sleep/usleep
function calls.

Signed-off-by: Daniel P. Berrange <dan@berrange.com>


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14996 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-04 18:08:46 +00:00
Marcus Meissner
3625ef8e1f cast the unsigned char*
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14906 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-11 20:30:39 +00:00
Marcus Meissner
18c4ba9cc4 From: "Daniel P. Berrange" <dan@berrange.com>
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
2014-04-11 20:25:20 +00:00
Marcus Meissner
669d3bfc2f From: "Daniel P. Berrange" <dan@berrange.com>
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
2014-04-11 20:19:32 +00:00
Marcus Meissner
292d2f69aa From: "Daniel P. Berrange" <dan@berrange.com>
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
2014-04-11 20:18:36 +00:00
Marcus Meissner
7318557c35 iFrom: "Daniel P. Berrange" <dan@berrange.com>
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
2014-04-11 20:15:34 +00:00
Marcus Meissner
ede0c8b20c added _BSD_SOURCE or _POSIX_C_SOURCE for -ansi building
replaced // comments with /* */ comments


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14246 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-02-20 17:37:37 +00:00
Marcus Meissner
74e6955296 removed gp_file_set_name
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11811 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-02-15 22:12:53 +00:00
Hans Ulrich Niedermann
4205c81334 Comment out unused functions.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9741 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-12-27 10:12:26 +00:00
Marcus Meissner
5259ecb79a some cleanups
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9407 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-11-19 18:44:13 +00:00
Hans Ulrich Niedermann
c96bda51dd Consistently use #include <gphoto2/gphoto2-foo.h> everywhere.
This moves the header files to a new subdirectory gphoto2 in both
  libgphoto2 and libphoto2_port/libgphoto2. All references are
  adapted appropriately.



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9221 67ed7778-7388-44ab-90cf-0a291f65f57c
2006-09-28 03:04:21 +00:00
Arnaud Launay
64e420e288 <config.h> -> "config.h"
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5859 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-11-29 16:09:58 +00:00
Hans Ulrich Niedermann
917ba5e7c3 gettext stuff for Arnaud
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5776 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-11-23 00:47:57 +00:00
Michael Koltan
2dbd5321ef Speed setup changes, timeout error in take_picture
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5441 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-25 15:39:31 +00:00
Michael Koltan
2bb1fc1a0a Set down the timeout values to speed up the driver
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5427 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-23 20:41:22 +00:00
Michael Koltan
0852cba178 Corrected the error recovery code in file download
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5426 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-23 20:01:35 +00:00
Michael Koltan
4c23049bd3 Improved error recovery in file download and removed bugs in
battery status and ac adapter connection display


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5406 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-10-20 10:43:29 +00:00
Michael Koltan
0a1219f51b Minor cleanups and added capture preview function
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5213 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-09-08 11:51:57 +00:00
Michael Koltan
c8ba299001 Added battery check and reliable speed setting code
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5211 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-09-07 22:47:44 +00:00
Michael Koltan
5880ee996d Implemented by_name functions using camera commands which take filenames
as arguments. Speeds up the download code for filelists, thumbnails and
deleting considerable (2 minutes instead of 2 hours in case of 32 MB
picture data). Also implemented the use of cfa thumbnails. Added a TODO list.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5204 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-09-05 22:33:20 +00:00
Michael Koltan
ac6dc56507 Sped up file listing (using other command)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5188 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-09-02 20:13:52 +00:00
Hubert Figuiere
e67cd255e6 New Kodak DC210 driver by Michael Koltan
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5134 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-08-26 12:40:18 +00:00
Hubert Figuiere
ff9c29fd41 The rest of the work I have done for DC210. I don't think it works.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4911 67ed7778-7388-44ab-90cf-0a291f65f57c
2002-07-25 19:10:46 +00:00
Colin Marquardt
f70b06a787 2001-10-25 Colin Marquardt <colin@marquardt-home.de>
* (Repository): s/retreiv/retriev/g
        * de.po: Update.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2728 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-10-24 23:19:26 +00:00
Lutz Mueller
33470e6369 2001-08-24 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* camlibs/sierra/library.c: Remove some unnecessary casts, put in some
        CHECKs
        * camlibs/kodak/dc120/dc120.c:
        * camlibs/kodak/dc210/library.c:
        * camlibs/kodak/dc240/library.c: Use gp_file_* instead of directly
        accessing the struct.
        * libgphoto2/filesys.c: Remove lots of redundancy, always check if
        folder has a trailing slash (and ignore it if this is the case).


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2065 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-08-24 08:53:41 +00:00
Hubert Figuiere
33330ff9d7 Initial release of DC210 driver port.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1994 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-08-16 22:06:43 +00:00