Browse Source

adsp.c does not need to be compiled with atalk support is not build, add a travis file, correct a code bug that prevented to compile on recent compiler

Godzil 7 years ago
parent
commit
552a4c73e9
4 changed files with 37 additions and 11 deletions
  1. 2 0
      .gitignore
  2. 23 0
      .travis.yml
  3. 4 3
      CMakeLists.txt
  4. 8 8
      lpstyl.c

+ 2 - 0
.gitignore

@@ -1,3 +1,5 @@
 build/
+cmake-*/
 *.o
 *~
+.idea/

+ 23 - 0
.travis.yml

@@ -0,0 +1,23 @@
+language: c
+os:
+  - linux
+  - osx
+matrix:
+  allow_failures:
+    - os: osx
+
+#addons:
+#  apt:
+#    packages:
+#      - atalk
+
+compiler:
+  - clang
+  - gcc
+
+script:
+  - mkdir build
+  - cd build
+  - cmake -DBUILD_ATALK=OFF -DCMAKE_BUILD_TYPE=Release ..
+  - cmake --build .
+  - cd ..

+ 4 - 3
CMakeLists.txt

@@ -5,9 +5,10 @@ project (lpstyl)
 option(BUILD_ATALK "Build AppleTalk support" OFF)
 
 if (BUILD_ATALK)
- find_library(LIB_ATALK atalk)
- add_definition(-DATALK=1)
+    find_library(LIB_ATALK atalk)
+    add_definition(-DATALK=1)
+    set(ATALK_SRC adsp.c)
 endif()
 
-add_executable(lpstyl lpstyl.c adsp.c)
+add_executable(lpstyl lpstyl.c ${ATALK_SRC})
 target_link_libraries(lpstyl ${LIB_ATALK})

+ 8 - 8
lpstyl.c

@@ -1037,10 +1037,10 @@ size_t readFileScanline(char *bufK, char *bufC, char *bufM, char *bufY)
 					if((i & 0x03) == 0)
 					{
 						/* write the output */
-						*((unsigned char *)bufK)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-						*((unsigned char *)bufY)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-						*((unsigned char *)bufM)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-						*((unsigned char *)bufC)++ = cmyk & 0x000000FF;
+						*((unsigned char *)bufK++) = cmyk & 0x000000FF;		cmyk >>= 8;
+						*((unsigned char *)bufY++) = cmyk & 0x000000FF;		cmyk >>= 8;
+						*((unsigned char *)bufM++) = cmyk & 0x000000FF;		cmyk >>= 8;
+						*((unsigned char *)bufC++) = cmyk & 0x000000FF;
 						cmyk = 0;
 					}
 				}
@@ -1053,10 +1053,10 @@ size_t readFileScanline(char *bufK, char *bufC, char *bufM, char *bufY)
 				}
 				
 				/* write the final part */
-				*((unsigned char *)bufK)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-				*((unsigned char *)bufY)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-				*((unsigned char *)bufM)++ = cmyk & 0x000000FF;		cmyk >>= 8;
-				*((unsigned char *)bufC)++ = cmyk & 0x000000FF;
+				*((unsigned char *)bufK++) = cmyk & 0x000000FF;		cmyk >>= 8;
+				*((unsigned char *)bufY++) = cmyk & 0x000000FF;		cmyk >>= 8;
+				*((unsigned char *)bufM++) = cmyk & 0x000000FF;		cmyk >>= 8;
+				*((unsigned char *)bufC++) = cmyk & 0x000000FF;
 			}
 			else
 			{