[poppler] fofi/FoFiIdentifier.cc fofi/FoFiIdentifier.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Sep 22 22:27:17 UTC 2018


 fofi/FoFiIdentifier.cc |   18 +++++++++---------
 fofi/FoFiIdentifier.h  |   18 ++++++++++++++++--
 2 files changed, 25 insertions(+), 11 deletions(-)

New commits:
commit ee0479eccbde05648fe5e0ecbcdf52f841271d97
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 00:16:48 2018 +0200

    FoFiIdentifier: make two char * be const char*

diff --git a/fofi/FoFiIdentifier.cc b/fofi/FoFiIdentifier.cc
index ffe9c47c..8843f9db 100644
--- a/fofi/FoFiIdentifier.cc
+++ b/fofi/FoFiIdentifier.cc
@@ -72,7 +72,7 @@ public:
 class MemReader: public Reader {
 public:
 
-  static MemReader *make(char *bufA, int lenA);
+  static MemReader *make(const char *bufA, int lenA);
   ~MemReader();
   int getByte(int pos) override;
   GBool getU16BE(int pos, int *val) override;
@@ -83,17 +83,17 @@ public:
 
 private:
 
-  MemReader(char *bufA, int lenA);
+  MemReader(const char *bufA, int lenA);
 
-  char *buf;
+  const char *buf;
   int len;
 };
 
-MemReader *MemReader::make(char *bufA, int lenA) {
+MemReader *MemReader::make(const char *bufA, int lenA) {
   return new MemReader(bufA, lenA);
 }
 
-MemReader::MemReader(char *bufA, int lenA) {
+MemReader::MemReader(const char *bufA, int lenA) {
   buf = bufA;
   len = lenA;
 }
@@ -167,7 +167,7 @@ GBool MemReader::cmp(int pos, const char *s) {
 class FileReader: public Reader {
 public:
 
-  static FileReader *make(char *fileName);
+  static FileReader *make(const char *fileName);
   ~FileReader();
   int getByte(int pos) override;
   GBool getU16BE(int pos, int *val) override;
@@ -186,7 +186,7 @@ private:
   int bufPos, bufLen;
 };
 
-FileReader *FileReader::make(char *fileName) {
+FileReader *FileReader::make(const char *fileName) {
   FILE *fA;
 
   if (!(fA = fopen(fileName, "rb"))) {
@@ -440,7 +440,7 @@ static FoFiIdentifierType identify(Reader *reader);
 static FoFiIdentifierType identifyOpenType(Reader *reader);
 static FoFiIdentifierType identifyCFF(Reader *reader, int start);
 
-FoFiIdentifierType FoFiIdentifier::identifyMem(char *file, int len) {
+FoFiIdentifierType FoFiIdentifier::identifyMem(const char *file, int len) {
   MemReader *reader;
   FoFiIdentifierType type;
 
@@ -452,7 +452,7 @@ FoFiIdentifierType FoFiIdentifier::identifyMem(char *file, int len) {
   return type;
 }
 
-FoFiIdentifierType FoFiIdentifier::identifyFile(char *fileName) {
+FoFiIdentifierType FoFiIdentifier::identifyFile(const char *fileName) {
   FileReader *reader;
   FoFiIdentifierType type;
 
diff --git a/fofi/FoFiIdentifier.h b/fofi/FoFiIdentifier.h
index af1323b7..2414b849 100644
--- a/fofi/FoFiIdentifier.h
+++ b/fofi/FoFiIdentifier.h
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2018 Albert Astals Cid <aacid at kde.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifndef FOFIIDENTIFIER_H
 #define FOFIIDENTIFIER_H
 
@@ -33,8 +47,8 @@ enum FoFiIdentifierType {
 class FoFiIdentifier {
 public:
 
-  static FoFiIdentifierType identifyMem(char *file, int len);
-  static FoFiIdentifierType identifyFile(char *fileName);
+  static FoFiIdentifierType identifyMem(const char *file, int len);
+  static FoFiIdentifierType identifyFile(const char *fileName);
   static FoFiIdentifierType identifyStream(int (*getChar)(void *data),
 					   void *data);
 };


More information about the poppler mailing list