summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-libs/rply/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-libs/rply/files')
-rw-r--r--media-libs/rply/files/rply-1.01-lc_numeric.patch86
-rw-r--r--media-libs/rply/files/rply-1.01-stdint.h.patch185
-rw-r--r--media-libs/rply/files/rply_CMakeLists.txt39
3 files changed, 310 insertions, 0 deletions
diff --git a/media-libs/rply/files/rply-1.01-lc_numeric.patch b/media-libs/rply/files/rply-1.01-lc_numeric.patch
new file mode 100644
index 000000000000..6d98abd95d57
--- /dev/null
+++ b/media-libs/rply/files/rply-1.01-lc_numeric.patch
@@ -0,0 +1,86 @@
+From 8a7a76b7dcc94e8e71725e26a146330c73377ebd Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gmail.com>
+Date: Mon, 26 Sep 2011 04:46:44 -0400
+Subject: [PATCH 2/2] Switch LC_NUMERIC locale to "C" for decimal point
+ separator safety
+
+Make sure to switch the LC_NUMERIC locale to "C" when using strtod() and
+fpritnf("%g",...) to ensure that '.' is used as the decimal point
+separator when reading and writing .ply files.
+---
+ rply.c | 31 +++++++++++++++++++++++++++----
+ 1 files changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/rply.c b/rply.c
+index 9eaa77f..789c002 100644
+--- a/rply.c
++++ b/rply.c
+@@ -12,6 +12,7 @@
+ #include <string.h>
+ #include <limits.h>
+ #include <float.h>
++#include <locale.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -1229,13 +1230,27 @@ static int oascii_uint32(p_ply ply, double value) {
+ }
+
+ static int oascii_float32(p_ply ply, double value) {
++ char *curr_locale;
++ int ret;
+ if (value < -FLT_MAX || value > FLT_MAX) return 0;
+- return fprintf(ply->fp, "%g ", (float) value) > 0;
++ /* Switch locale to C to use '.' as the decimal point separator */
++ curr_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ ret = fprintf(ply->fp, "%g ", (float) value);
++ setlocale(LC_NUMERIC, curr_locale);
++ return ret > 0;
+ }
+
+ static int oascii_float64(p_ply ply, double value) {
++ char *curr_locale;
++ int ret;
+ if (value < -DBL_MAX || value > DBL_MAX) return 0;
+- return fprintf(ply->fp, "%g ", value) > 0;
++ /* Switch locale to C to use '.' as the decimal point separator */
++ curr_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ ret = fprintf(ply->fp, "%g ", value);
++ setlocale(LC_NUMERIC, curr_locale);
++ return ret > 0;
+ }
+
+ static int obinary_int8(p_ply ply, double value) {
+@@ -1336,17 +1351,25 @@ static int iascii_uint32(p_ply ply, double *value) {
+ }
+
+ static int iascii_float32(p_ply ply, double *value) {
+- char *end;
++ char *end, *curr_locale;
+ if (!ply_read_word(ply)) return 0;
++ /* Switch locale to C to use '.' as the decimal point separator */
++ curr_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
+ *value = strtod(BWORD(ply), &end);
++ setlocale(LC_NUMERIC, curr_locale);
+ if (*end || *value < -FLT_MAX || *value > FLT_MAX) return 0;
+ return 1;
+ }
+
+ static int iascii_float64(p_ply ply, double *value) {
+- char *end;
++ char *end, *curr_locale;
+ if (!ply_read_word(ply)) return 0;
++ /* Switch locale to C to use '.' as the decimal point separator */
++ curr_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
+ *value = strtod(BWORD(ply), &end);
++ setlocale(LC_NUMERIC, curr_locale);
+ if (*end || *value < -DBL_MAX || *value > DBL_MAX) return 0;
+ return 1;
+ }
+--
+1.7.6.1
+
diff --git a/media-libs/rply/files/rply-1.01-stdint.h.patch b/media-libs/rply/files/rply-1.01-stdint.h.patch
new file mode 100644
index 000000000000..45c911643bcb
--- /dev/null
+++ b/media-libs/rply/files/rply-1.01-stdint.h.patch
@@ -0,0 +1,185 @@
+From eeb09032068baed6d81cff01cdfcccd6d55a8152 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gmail.com>
+Date: Mon, 26 Sep 2011 04:45:49 -0400
+Subject: [PATCH 1/2] Use stdint.h types
+
+Use stdint.h types (int16_t and int32_t) instead of assuming that short
+and long must always a specific number of bytes. Also, use strtoul for
+reading uint32_t values.
+---
+ rply.c | 61 ++++++++++++++++++++++++++++---------------------------------
+ 1 files changed, 28 insertions(+), 33 deletions(-)
+
+diff --git a/rply.c b/rply.c
+index 042244f..9eaa77f 100644
+--- a/rply.c
++++ b/rply.c
+@@ -15,6 +15,7 @@
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <stddef.h>
++#include <stdint.h>
+
+ #include "rply.h"
+
+@@ -1183,18 +1184,12 @@ static e_ply_storage_mode ply_arch_endian(void) {
+ static int ply_type_check(void) {
+ assert(sizeof(char) == 1);
+ assert(sizeof(unsigned char) == 1);
+- assert(sizeof(short) == 2);
+- assert(sizeof(unsigned short) == 2);
+- assert(sizeof(long) == 4);
+- assert(sizeof(unsigned long) == 4);
++ assert(sizeof(long) >= 4);
+ assert(sizeof(float) == 4);
+ assert(sizeof(double) == 8);
+ if (sizeof(char) != 1) return 0;
+ if (sizeof(unsigned char) != 1) return 0;
+- if (sizeof(short) != 2) return 0;
+- if (sizeof(unsigned short) != 2) return 0;
+- if (sizeof(long) != 4) return 0;
+- if (sizeof(unsigned long) != 4) return 0;
++ if (sizeof(long) < 4) return 0;
+ if (sizeof(float) != 4) return 0;
+ if (sizeof(double) != 8) return 0;
+ return 1;
+@@ -1214,23 +1209,23 @@ static int oascii_uint8(p_ply ply, double value) {
+ }
+
+ static int oascii_int16(p_ply ply, double value) {
+- if (value > SHRT_MAX || value < SHRT_MIN) return 0;
+- return fprintf(ply->fp, "%d ", (short) value) > 0;
++ if (value > INT16_MAX || value < INT16_MIN) return 0;
++ return fprintf(ply->fp, "%d ", (int16_t) value) > 0;
+ }
+
+ static int oascii_uint16(p_ply ply, double value) {
+- if (value > USHRT_MAX || value < 0) return 0;
+- return fprintf(ply->fp, "%d ", (unsigned short) value) > 0;
++ if (value > UINT16_MAX || value < 0) return 0;
++ return fprintf(ply->fp, "%d ", (uint16_t) value) > 0;
+ }
+
+ static int oascii_int32(p_ply ply, double value) {
+- if (value > LONG_MAX || value < LONG_MIN) return 0;
+- return fprintf(ply->fp, "%d ", (int) value) > 0;
++ if (value > INT32_MAX || value < INT32_MIN) return 0;
++ return fprintf(ply->fp, "%d ", (int32_t) value) > 0;
+ }
+
+ static int oascii_uint32(p_ply ply, double value) {
+- if (value > ULONG_MAX || value < 0) return 0;
+- return fprintf(ply->fp, "%d ", (unsigned int) value) > 0;
++ if (value > UINT32_MAX || value < 0) return 0;
++ return fprintf(ply->fp, "%d ", (uint32_t) value) > 0;
+ }
+
+ static int oascii_float32(p_ply ply, double value) {
+@@ -1256,26 +1251,26 @@ static int obinary_uint8(p_ply ply, double value) {
+ }
+
+ static int obinary_int16(p_ply ply, double value) {
+- short int16 = (short) value;
+- if (value > SHRT_MAX || value < SHRT_MIN) return 0;
++ int16_t int16 = value;
++ if (value > INT16_MAX || value < INT16_MIN) return 0;
+ return ply->odriver->ochunk(ply, &int16, sizeof(int16));
+ }
+
+ static int obinary_uint16(p_ply ply, double value) {
+- unsigned short uint16 = (unsigned short) value;
+- if (value > USHRT_MAX || value < 0) return 0;
++ uint16_t uint16 = value;
++ if (value > UINT16_MAX || value < 0) return 0;
+ return ply->odriver->ochunk(ply, &uint16, sizeof(uint16));
+ }
+
+ static int obinary_int32(p_ply ply, double value) {
+- long int32 = (long) value;
+- if (value > LONG_MAX || value < LONG_MIN) return 0;
++ int32_t int32 = value;
++ if (value > INT32_MAX || value < INT32_MIN) return 0;
+ return ply->odriver->ochunk(ply, &int32, sizeof(int32));
+ }
+
+ static int obinary_uint32(p_ply ply, double value) {
+- unsigned long uint32 = (unsigned long) value;
+- if (value > ULONG_MAX || value < 0) return 0;
++ uint32_t uint32 = value;
++ if (value > UINT32_MAX || value < 0) return 0;
+ return ply->odriver->ochunk(ply, &uint32, sizeof(uint32));
+ }
+
+@@ -1312,7 +1307,7 @@ static int iascii_int16(p_ply ply, double *value) {
+ char *end;
+ if (!ply_read_word(ply)) return 0;
+ *value = strtol(BWORD(ply), &end, 10);
+- if (*end || *value > SHRT_MAX || *value < SHRT_MIN) return 0;
++ if (*end || *value > INT16_MAX || *value < INT16_MIN) return 0;
+ return 1;
+ }
+
+@@ -1320,7 +1315,7 @@ static int iascii_uint16(p_ply ply, double *value) {
+ char *end;
+ if (!ply_read_word(ply)) return 0;
+ *value = strtol(BWORD(ply), &end, 10);
+- if (*end || *value > USHRT_MAX || *value < 0) return 0;
++ if (*end || *value > UINT16_MAX || *value < 0) return 0;
+ return 1;
+ }
+
+@@ -1328,15 +1323,15 @@ static int iascii_int32(p_ply ply, double *value) {
+ char *end;
+ if (!ply_read_word(ply)) return 0;
+ *value = strtol(BWORD(ply), &end, 10);
+- if (*end || *value > LONG_MAX || *value < LONG_MIN) return 0;
++ if (*end || *value > INT32_MAX || *value < INT32_MIN) return 0;
+ return 1;
+ }
+
+ static int iascii_uint32(p_ply ply, double *value) {
+ char *end;
+ if (!ply_read_word(ply)) return 0;
+- *value = strtol(BWORD(ply), &end, 10);
+- if (*end || *value < 0) return 0;
++ *value = strtoul(BWORD(ply), &end, 10);
++ if (*end || *value > UINT32_MAX || *value < 0) return 0;
+ return 1;
+ }
+
+@@ -1371,28 +1366,28 @@ static int ibinary_uint8(p_ply ply, double *value) {
+ }
+
+ static int ibinary_int16(p_ply ply, double *value) {
+- short int16;
++ int16_t int16;
+ if (!ply->idriver->ichunk(ply, &int16, sizeof(int16))) return 0;
+ *value = int16;
+ return 1;
+ }
+
+ static int ibinary_uint16(p_ply ply, double *value) {
+- unsigned short uint16;
++ uint16_t uint16;
+ if (!ply->idriver->ichunk(ply, &uint16, sizeof(uint16))) return 0;
+ *value = uint16;
+ return 1;
+ }
+
+ static int ibinary_int32(p_ply ply, double *value) {
+- long int32;
++ int32_t int32;
+ if (!ply->idriver->ichunk(ply, &int32, sizeof(int32))) return 0;
+ *value = int32;
+ return 1;
+ }
+
+ static int ibinary_uint32(p_ply ply, double *value) {
+- unsigned long uint32;
++ uint32_t uint32;
+ if (!ply->idriver->ichunk(ply, &uint32, sizeof(uint32))) return 0;
+ *value = uint32;
+ return 1;
+--
+1.7.6.1
+
diff --git a/media-libs/rply/files/rply_CMakeLists.txt b/media-libs/rply/files/rply_CMakeLists.txt
new file mode 100644
index 000000000000..5497fffb225f
--- /dev/null
+++ b/media-libs/rply/files/rply_CMakeLists.txt
@@ -0,0 +1,39 @@
+# Fedora's cmake file for rply
+# http://pkgs.fedoraproject.org/gitweb/?p=rply.git;a=blob;f=rply_CMakeLists.txt
+PROJECT(rply)
+cmake_minimum_required(VERSION 2.6)
+
+SET(RPLY_LIB_MAJOR_VERSION 1)
+SET(RPLY_LIB_MINOR_VERSION 01)
+
+SET(RPLY_CMAKE_DIR ${CMAKE_SOURCE_DIR}/CMake/ )
+SET(RPLY_LIBRARY librply.so )
+
+add_library(rply SHARED rply.c )
+set_target_properties( rply PROPERTIES
+ VERSION ${RPLY_LIB_MAJOR_VERSION}.${RPLY_LIB_MINOR_VERSION}
+ SOVERSION ${RPLY_LIB_MAJOR_VERSION}
+ )
+
+include_directories( ${CMAKE_SOURCE_DIR} )
+add_executable(rply_convert etc/convert.c )
+add_executable(rply_dump etc/dump.c )
+add_executable(rply_sconvert etc/sconvert.c )
+target_link_libraries (rply_convert rply)
+target_link_libraries (rply_dump rply)
+target_link_libraries (rply_sconvert rply)
+
+# Installs the header files
+install(FILES rply.h DESTINATION include/rply)
+
+# Installs the target file
+install(TARGETS rply LIBRARY DESTINATION lib${LIB_SUFFIX})
+install(TARGETS rply_convert RUNTIME DESTINATION bin)
+install(TARGETS rply_dump RUNTIME DESTINATION bin)
+install(TARGETS rply_sconvert RUNTIME DESTINATION bin)
+
+#This should be the last line of the project
+SUBDIRS( CMake/export )
+
+
+