Martijn Braam 1 year ago
parent
commit
d462861827
5 changed files with 19 additions and 6 deletions
  1. 8 0
      .gitlab-ci.yml
  2. 1 0
      include/libdng.h
  3. 8 5
      meson.build
  4. 1 1
      src/dcp.c
  5. 1 0
      src/mode.h

+ 8 - 0
.gitlab-ci.yml

@@ -0,0 +1,8 @@
+build:
+  image: alpine:edge
+  before_script:
+    - apk add --no-cache build-base meson samurai tiff-dev linux-headers scdoc
+  script:
+    - meson build --buildtype release --werror
+    - ninja -C build
+    - cd build && meson test --no-rebuild

+ 1 - 0
include/libdng.h

@@ -4,6 +4,7 @@
 #include <limits.h>
 #include <time.h>
 #include <stdint.h>
+#include <stdbool.h>
 
 #define EXPORT __attribute__((__visibility__("default")))
 

+ 8 - 5
meson.build

@@ -36,6 +36,7 @@ lib_src = [
 ]
 
 add_project_arguments(['-Wno-multichar'], language: 'c')
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
 libdng = shared_library('dng', lib_src,
     version: libdng_so_version,
@@ -58,11 +59,13 @@ makedng = executable('makedng', 'util/makedng.c',
 )
 
 test_dng_validate = find_program('tests/test_dng_validate.sh')
-dng_validate = find_program('dng_validate')
-test('dng_validate', test_dng_validate,
-    args: [makedng.full_path()],
-    suite: 'adobe',
-)
+dng_validate = find_program('dng_validate', required: false)
+if dng_validate.found()
+    test('dng_validate', test_dng_validate,
+        args: [makedng.full_path()],
+        suite: 'adobe',
+    )
+endif
 
 scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true)
 if scdoc.found()

+ 1 - 1
src/dcp.c

@@ -77,7 +77,7 @@ libdng_load_calibration_file(libdng_info *dng, const char *path)
 	for (int i = 0; i < tag_count; i++) {
 		int tag_offset = ifd0 + 2 + (i * 12);
 		unsigned int tag = get_int16(buffer, tag_offset + 0);
-		unsigned int type = get_int16(buffer, tag_offset + 2);
+		// unsigned int type = get_int16(buffer, tag_offset + 2);
 		unsigned int count = get_int32(buffer, tag_offset + 4);
 		unsigned int offset = get_int32(buffer, tag_offset + 8);
 

+ 1 - 0
src/mode.h

@@ -1,4 +1,5 @@
 #include <stdint.h>
+#include <stdbool.h>
 
 #pragma once