summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-22 21:34:40 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-22 21:34:40 +0000
commit29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b (patch)
tree25cc5007583387038dc70ebe76a45572268a4610
parenteea7432ba4a196ccbaba981b96af8ff8af0d86d0 (diff)
downloadnuttx-29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b.tar.gz
nuttx-29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b.tar.bz2
nuttx-29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b.zip
Minor TIFF updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3971 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--apps/graphics/tiff/tiff_initialize.c16
-rw-r--r--apps/graphics/tiff/tiff_utils.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/apps/graphics/tiff/tiff_initialize.c b/apps/graphics/tiff/tiff_initialize.c
index a7194d552..b7eb3bd41 100644
--- a/apps/graphics/tiff/tiff_initialize.c
+++ b/apps/graphics/tiff/tiff_initialize.c
@@ -203,14 +203,18 @@
#define TIFF_RGB_STRIPBCOFFSET 248
/* Debug *******************************************************************/
+/* CONFIG_DEBUG_TIFFOFFSETS may be defined (along with CONFIG_DEBUG and
+ * CONFIG_DEBUG_GRAPHICS) in order to verify the pre-determined TIFF file
+ * offsets.
+ */
-#ifndef CONFIG_DEBUG
-# undef CONFIG_DEBUG_GRAPHICS
+#if !defined(CONFIG_DEBUG) || !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG_TIFFOFFSETS
#endif
-#ifdef CONFIG_DEBUG_GRAPHICS
+#ifdef CONFIG_DEBUG_TIFFOFFSETS
# define tiff_offset(o,l) (o) += (l)
-# define tiff_checkoffs(o,x) ASSERT((o) == (x));
+# define tiff_checkoffs(o,x) ASSERT((o) == (x))
#else
# define tiff_offset(o,l)
# define tiff_checkoffs(o,x)
@@ -307,7 +311,7 @@ static inline int tiff_putheader(FAR struct tiff_info_s *info)
/* 4-7: Offset to the first IFD */
- tiff_put16(hdr.offset, TIFF_IFD_OFFSET);
+ tiff_put32(hdr.offset, TIFF_IFD_OFFSET);
/* Write the header to the output file */
@@ -446,7 +450,7 @@ static int tiff_datetime(FAR char *timbuf, unsigned int buflen)
int tiff_initialize(FAR struct tiff_info_s *info)
{
uint16_t val16;
-#if CONFIG_DEBUG_GRAPHICS
+#if CONFIG_DEBUG_TIFFOFFSETS
off_t offset = 0;
#endif
char timbuf[TIFF_DATETIME_STRLEN + 8];
diff --git a/apps/graphics/tiff/tiff_utils.c b/apps/graphics/tiff/tiff_utils.c
index 66599db8b..c326d0274 100644
--- a/apps/graphics/tiff/tiff_utils.c
+++ b/apps/graphics/tiff/tiff_utils.c
@@ -378,4 +378,4 @@ ssize_t tiff_wordalign(int fd, size_t size)
size += nbytes;
}
return size;
-} \ No newline at end of file
+}