forked from libgd/libgd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert all files to native line encodings
A bunch of these files were committed with Windows line encodings. Strip all those ^M gremlins out as people working on Windows can use git's autocrlf setting to convert back and forth as needed.
- Loading branch information
Showing
30 changed files
with
1,438 additions
and
1,502 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
############################################################################# | ||
# | ||
# $Id: FindPTHREAD.cmake 4056 2013-01-05 13:04:42Z fspindle $ | ||
# | ||
# This file is part of the ViSP software. | ||
# Copyright (C) 2005 - 2013 by INRIA. All rights reserved. | ||
# | ||
# This software is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# ("GPL") version 2 as published by the Free Software Foundation. | ||
# See the file LICENSE.txt at the root directory of this source | ||
# distribution for additional information about the GNU GPL. | ||
# | ||
# For using ViSP with software that can not be combined with the GNU | ||
# GPL, please contact INRIA about acquiring a ViSP Professional | ||
# Edition License. | ||
# | ||
# See http://www.irisa.fr/lagadic/visp/visp.html for more information. | ||
# | ||
# This software was developed at: | ||
# INRIA Rennes - Bretagne Atlantique | ||
# Campus Universitaire de Beaulieu | ||
# 35042 Rennes Cedex | ||
# France | ||
# http://www.irisa.fr/lagadic | ||
# | ||
# If you have questions regarding the use of this file, please contact | ||
# INRIA at [email protected] | ||
# | ||
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# Description: | ||
# Try to find pthread library. | ||
# Once run this will define: | ||
# | ||
# PTHREAD_FOUND | ||
# PTHREAD_INCLUDE_DIRS | ||
# PTHREAD_LIBRARIES | ||
# | ||
# Authors: | ||
# Fabien Spindler | ||
# | ||
############################################################################# | ||
|
||
FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h | ||
"$ENV{PTHREAD_HOME}/include" | ||
"$ENV{PTHREAD_DIR}/include" | ||
/usr/include | ||
"C:/MinGW/include" | ||
) | ||
#MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") | ||
# pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web | ||
FIND_LIBRARY(PTHREAD_LIBRARY | ||
NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 | ||
PATHS | ||
"$ENV{PTHREAD_HOME}/lib" | ||
"$ENV{PTHREAD_DIR}/lib" | ||
/usr/lib | ||
/usr/local/lib | ||
/lib | ||
"C:/MinGW/lib" | ||
) | ||
|
||
#MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") | ||
## -------------------------------- | ||
IF(PTHREAD_LIBRARY) | ||
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) | ||
ELSE(PTHREAD_LIBRARY) | ||
#MESSAGE(SEND_ERROR "pthread library not found.") | ||
ENDIF(PTHREAD_LIBRARY) | ||
IF(NOT PTHREAD_INCLUDE_DIR) | ||
#MESSAGE(SEND_ERROR "pthread include dir not found.") | ||
ENDIF(NOT PTHREAD_INCLUDE_DIR) | ||
IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) | ||
SET(PTHREAD_FOUND TRUE) | ||
ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
SET(PTHREAD_FOUND FALSE) | ||
ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
MARK_AS_ADVANCED( | ||
PTHREAD_INCLUDE_DIR | ||
PTHREAD_LIBRARY | ||
) | ||
#MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") | ||
############################################################################# | ||
# | ||
# $Id: FindPTHREAD.cmake 4056 2013-01-05 13:04:42Z fspindle $ | ||
# | ||
# This file is part of the ViSP software. | ||
# Copyright (C) 2005 - 2013 by INRIA. All rights reserved. | ||
# | ||
# This software is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# ("GPL") version 2 as published by the Free Software Foundation. | ||
# See the file LICENSE.txt at the root directory of this source | ||
# distribution for additional information about the GNU GPL. | ||
# | ||
# For using ViSP with software that can not be combined with the GNU | ||
# GPL, please contact INRIA about acquiring a ViSP Professional | ||
# Edition License. | ||
# | ||
# See http://www.irisa.fr/lagadic/visp/visp.html for more information. | ||
# | ||
# This software was developed at: | ||
# INRIA Rennes - Bretagne Atlantique | ||
# Campus Universitaire de Beaulieu | ||
# 35042 Rennes Cedex | ||
# France | ||
# http://www.irisa.fr/lagadic | ||
# | ||
# If you have questions regarding the use of this file, please contact | ||
# INRIA at [email protected] | ||
# | ||
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# Description: | ||
# Try to find pthread library. | ||
# Once run this will define: | ||
# | ||
# PTHREAD_FOUND | ||
# PTHREAD_INCLUDE_DIRS | ||
# PTHREAD_LIBRARIES | ||
# | ||
# Authors: | ||
# Fabien Spindler | ||
# | ||
############################################################################# | ||
|
||
|
||
FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h | ||
"$ENV{PTHREAD_HOME}/include" | ||
"$ENV{PTHREAD_DIR}/include" | ||
/usr/include | ||
"C:/MinGW/include" | ||
) | ||
#MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") | ||
|
||
# pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web | ||
FIND_LIBRARY(PTHREAD_LIBRARY | ||
NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 | ||
PATHS | ||
"$ENV{PTHREAD_HOME}/lib" | ||
"$ENV{PTHREAD_DIR}/lib" | ||
/usr/lib | ||
/usr/local/lib | ||
/lib | ||
"C:/MinGW/lib" | ||
) | ||
|
||
#MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") | ||
|
||
## -------------------------------- | ||
|
||
IF(PTHREAD_LIBRARY) | ||
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) | ||
ELSE(PTHREAD_LIBRARY) | ||
#MESSAGE(SEND_ERROR "pthread library not found.") | ||
ENDIF(PTHREAD_LIBRARY) | ||
|
||
IF(NOT PTHREAD_INCLUDE_DIR) | ||
#MESSAGE(SEND_ERROR "pthread include dir not found.") | ||
ENDIF(NOT PTHREAD_INCLUDE_DIR) | ||
|
||
IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) | ||
SET(PTHREAD_FOUND TRUE) | ||
ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
SET(PTHREAD_FOUND FALSE) | ||
ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) | ||
|
||
MARK_AS_ADVANCED( | ||
PTHREAD_INCLUDE_DIR | ||
PTHREAD_LIBRARY | ||
) | ||
#MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
/** | ||
* Regression test for github issue #209 | ||
* | ||
* We're testing that bug00209.gd2, which claims to have 12336 x 48 pixels, but | ||
* actually provides not enough image data, is rejected, i.e. that | ||
* gdImageCreateFromGd2() returns NULL | ||
* | ||
* See <https://github.com/libgd/libgd/issues/209>. | ||
*/ | ||
|
||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
|
||
int main() | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00209.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
return gdNumFailures(); | ||
} | ||
/** | ||
* Regression test for github issue #209 | ||
* | ||
* We're testing that bug00209.gd2, which claims to have 12336 x 48 pixels, but | ||
* actually provides not enough image data, is rejected, i.e. that | ||
* gdImageCreateFromGd2() returns NULL | ||
* | ||
* See <https://github.com/libgd/libgd/issues/209>. | ||
*/ | ||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
int main() | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00209.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
return gdNumFailures(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
/** | ||
* We're testing GD2 image files which report illegal chunk counts. These should | ||
* not cause integer overflows or other issues, but instead simply fail to be | ||
* loaded. | ||
* | ||
* See also <https://github.com/libgd/libgd/issues/354>. | ||
*/ | ||
|
||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
|
||
int main() | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00354a.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00354b.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
return gdNumFailures(); | ||
} | ||
/** | ||
* We're testing GD2 image files which report illegal chunk counts. These should | ||
* not cause integer overflows or other issues, but instead simply fail to be | ||
* loaded. | ||
* | ||
* See also <https://github.com/libgd/libgd/issues/354>. | ||
*/ | ||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
int main() | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00354a.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
fp = gdTestFileOpen2("gd2", "bug00354b.gd2"); | ||
gdTestAssert(fp != NULL); | ||
im = gdImageCreateFromGd2(fp); | ||
gdTestAssert(im == NULL); | ||
fclose(fp); | ||
|
||
return gdNumFailures(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
/** | ||
* Basic test for gdImageBrightness() | ||
*/ | ||
|
||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
|
||
static void test_brightness(int brightness); | ||
|
||
|
||
int main() | ||
{ | ||
test_brightness(+100); | ||
test_brightness(-100); | ||
|
||
return gdNumFailures(); | ||
} | ||
|
||
|
||
static void test_brightness(int brightness) | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
char basename[256]; | ||
char *path; | ||
|
||
fp = gdTestFileOpen2("gdimagebrightness", "basic.png"); | ||
im = gdImageCreateFromPng(fp); | ||
fclose(fp); | ||
|
||
gdImageBrightness(im, brightness); | ||
|
||
sprintf(basename, "basic%+03d.png", brightness); | ||
path = gdTestFilePath2("gdimagebrightness", basename); | ||
gdAssertImageEqualsToFile(path, im); | ||
gdFree(path); | ||
|
||
gdImageDestroy(im); | ||
} | ||
/** | ||
* Basic test for gdImageBrightness() | ||
*/ | ||
|
||
#include "gd.h" | ||
#include "gdtest.h" | ||
|
||
static void test_brightness(int brightness); | ||
|
||
int main() | ||
{ | ||
test_brightness(+100); | ||
test_brightness(-100); | ||
|
||
return gdNumFailures(); | ||
} | ||
|
||
static void test_brightness(int brightness) | ||
{ | ||
gdImagePtr im; | ||
FILE *fp; | ||
char basename[256]; | ||
char *path; | ||
|
||
fp = gdTestFileOpen2("gdimagebrightness", "basic.png"); | ||
im = gdImageCreateFromPng(fp); | ||
fclose(fp); | ||
|
||
gdImageBrightness(im, brightness); | ||
|
||
sprintf(basename, "basic%+03d.png", brightness); | ||
path = gdTestFilePath2("gdimagebrightness", basename); | ||
gdAssertImageEqualsToFile(path, im); | ||
gdFree(path); | ||
|
||
gdImageDestroy(im); | ||
} |
Oops, something went wrong.