summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-28 11:36:12 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-28 11:36:12 +0000
commitfacbc3fa3a478c87282c3f95ba056c6711e5e96d (patch)
tree87fb89fcaa583ff61d22e4e0008c30cf49671459 /Build/source/texk/web2c/luatexdir/image
parenta5246f1800214ff97fd44ead17f33be86099885a (diff)
luaTeX: Enable g++ warnings and avoid most of them
git-svn-id: svn://tug.org/texlive/trunk@38228 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/epdf.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.w9
2 files changed, 6 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h
index c0d17b29778..c7f475eaa95 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.h
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.h
@@ -194,6 +194,6 @@ struct PdfDocument {
unsigned int pc; // counter to track PDFDoc generation or deletion
};
-PdfDocument *refPdfDocument(char *file_path, file_error_mode fe);
+PdfDocument *refPdfDocument(const char *file_path, file_error_mode fe);
#endif /* EPDF_H */
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
index 82da2a2b012..6e214c13cc7 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -46,20 +46,21 @@ static int CompPdfDocument(const void *pa, const void *pb, void * /*p */ )
// Returns pointer to PdfDocument structure for PDF file.
-static PdfDocument *findPdfDocument(char *file_path)
+static PdfDocument *findPdfDocument(const char *file_path)
{
PdfDocument *pdf_doc, tmp;
assert(file_path != NULL);
if (PdfDocumentTree == NULL)
return NULL;
- tmp.file_path = file_path;
+ tmp.file_path = xstrdup(file_path);
pdf_doc = (PdfDocument *) avl_find(PdfDocumentTree, &tmp);
+ free(tmp.file_path);
return pdf_doc;
}
#define PDF_CHECKSUM_SIZE 32
-static char *get_file_checksum(char *a, file_error_mode fe)
+static char *get_file_checksum(const char *a, file_error_mode fe)
{
struct stat finfo;
char *ck = NULL;
@@ -93,7 +94,7 @@ static char *get_file_checksum(char *a, file_error_mode fe)
// Creates a new PdfDocument structure if it doesn't exist yet.
// When fe = FE_RETURN_NULL, the function returns NULL in error case.
-PdfDocument *refPdfDocument(char *file_path, file_error_mode fe)
+PdfDocument *refPdfDocument(const char *file_path, file_error_mode fe)
{
char *checksum;
PdfDocument *pdf_doc;