Commit da68f394 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

riched20: Constify some variables.

parent 80a1a2f1
...@@ -92,7 +92,7 @@ static void RTFPutCodePageChar(RTF_Info *info, int c); ...@@ -92,7 +92,7 @@ static void RTFPutCodePageChar(RTF_Info *info, int c);
/* /*
* Saves a string on the heap and returns a pointer to it. * Saves a string on the heap and returns a pointer to it.
*/ */
static inline char *RTFStrSave(char *s) static inline char *RTFStrSave(const char *s)
{ {
char *p; char *p;
...@@ -254,7 +254,7 @@ void RTFInit(RTF_Info *info) ...@@ -254,7 +254,7 @@ void RTFInit(RTF_Info *info)
* to be accurate, only insofar as the calling program makes them so. * to be accurate, only insofar as the calling program makes them so.
*/ */
void RTFSetInputName(RTF_Info *info, char *name) void RTFSetInputName(RTF_Info *info, const char *name)
{ {
info->inputName = RTFStrSave (name); info->inputName = RTFStrSave (name);
if (info->inputName == NULL) if (info->inputName == NULL)
...@@ -262,13 +262,13 @@ void RTFSetInputName(RTF_Info *info, char *name) ...@@ -262,13 +262,13 @@ void RTFSetInputName(RTF_Info *info, char *name)
} }
char *RTFGetInputName(RTF_Info *info) char *RTFGetInputName(const RTF_Info *info)
{ {
return (info->inputName); return (info->inputName);
} }
void RTFSetOutputName(RTF_Info *info, char *name) void RTFSetOutputName(RTF_Info *info, const char *name)
{ {
info->outputName = RTFStrSave (name); info->outputName = RTFStrSave (name);
if (info->outputName == NULL) if (info->outputName == NULL)
...@@ -276,7 +276,7 @@ void RTFSetOutputName(RTF_Info *info, char *name) ...@@ -276,7 +276,7 @@ void RTFSetOutputName(RTF_Info *info, char *name)
} }
char *RTFGetOutputName(RTF_Info *info) char *RTFGetOutputName(const RTF_Info *info)
{ {
return (info->outputName); return (info->outputName);
} }
...@@ -301,7 +301,7 @@ void RTFSetClassCallback(RTF_Info *info, int class, RTFFuncPtr callback) ...@@ -301,7 +301,7 @@ void RTFSetClassCallback(RTF_Info *info, int class, RTFFuncPtr callback)
} }
RTFFuncPtr RTFGetClassCallback(RTF_Info *info, int class) RTFFuncPtr RTFGetClassCallback(const RTF_Info *info, int class)
{ {
if (class >= 0 && class < rtfMaxClass) if (class >= 0 && class < rtfMaxClass)
return info->ccb[class]; return info->ccb[class];
...@@ -320,7 +320,7 @@ void RTFSetDestinationCallback(RTF_Info *info, int dest, RTFFuncPtr callback) ...@@ -320,7 +320,7 @@ void RTFSetDestinationCallback(RTF_Info *info, int dest, RTFFuncPtr callback)
} }
RTFFuncPtr RTFGetDestinationCallback(RTF_Info *info, int dest) RTFFuncPtr RTFGetDestinationCallback(const RTF_Info *info, int dest)
{ {
if (dest >= 0 && dest < rtfMaxDestination) if (dest >= 0 && dest < rtfMaxDestination)
return info->dcb[dest]; return info->dcb[dest];
...@@ -447,7 +447,7 @@ void RTFSetReadHook(RTF_Info *info, RTFFuncPtr f) ...@@ -447,7 +447,7 @@ void RTFSetReadHook(RTF_Info *info, RTFFuncPtr f)
} }
RTFFuncPtr RTFGetReadHook(RTF_Info *info) RTFFuncPtr RTFGetReadHook(const RTF_Info *info)
{ {
return (info->readHook); return (info->readHook);
} }
...@@ -1258,7 +1258,7 @@ static void ReadObjGroup(RTF_Info *info) ...@@ -1258,7 +1258,7 @@ static void ReadObjGroup(RTF_Info *info)
*/ */
RTFStyle *RTFGetStyle(RTF_Info *info, int num) RTFStyle *RTFGetStyle(const RTF_Info *info, int num)
{ {
RTFStyle *s; RTFStyle *s;
...@@ -1273,7 +1273,7 @@ RTFStyle *RTFGetStyle(RTF_Info *info, int num) ...@@ -1273,7 +1273,7 @@ RTFStyle *RTFGetStyle(RTF_Info *info, int num)
} }
RTFFont *RTFGetFont(RTF_Info *info, int num) RTFFont *RTFGetFont(const RTF_Info *info, int num)
{ {
RTFFont *f; RTFFont *f;
...@@ -1288,7 +1288,7 @@ RTFFont *RTFGetFont(RTF_Info *info, int num) ...@@ -1288,7 +1288,7 @@ RTFFont *RTFGetFont(RTF_Info *info, int num)
} }
RTFColor *RTFGetColor(RTF_Info *info, int num) RTFColor *RTFGetColor(const RTF_Info *info, int num)
{ {
RTFColor *c; RTFColor *c;
...@@ -2373,19 +2373,19 @@ static int Hash(const char *s) ...@@ -2373,19 +2373,19 @@ static int Hash(const char *s)
* Token comparison routines * Token comparison routines
*/ */
int RTFCheckCM(RTF_Info *info, int class, int major) int RTFCheckCM(const RTF_Info *info, int class, int major)
{ {
return (info->rtfClass == class && info->rtfMajor == major); return (info->rtfClass == class && info->rtfMajor == major);
} }
int RTFCheckCMM(RTF_Info *info, int class, int major, int minor) int RTFCheckCMM(const RTF_Info *info, int class, int major, int minor)
{ {
return (info->rtfClass == class && info->rtfMajor == major && info->rtfMinor == minor); return (info->rtfClass == class && info->rtfMajor == major && info->rtfMinor == minor);
} }
int RTFCheckMM(RTF_Info *info, int major, int minor) int RTFCheckMM(const RTF_Info *info, int major, int minor)
{ {
return (info->rtfMajor == major && info->rtfMinor == minor); return (info->rtfMajor == major && info->rtfMinor == minor);
} }
...@@ -2661,7 +2661,7 @@ RTFFlushUnicodeOutputBuffer(RTF_Info *info) ...@@ -2661,7 +2661,7 @@ RTFFlushUnicodeOutputBuffer(RTF_Info *info)
} }
static void static void
RTFPutUnicodeString(RTF_Info *info, WCHAR *string, int length) RTFPutUnicodeString(RTF_Info *info, const WCHAR *string, int length)
{ {
if (info->dwCPOutputCount) if (info->dwCPOutputCount)
RTFFlushCPOutputBuffer(info); RTFFlushCPOutputBuffer(info);
......
...@@ -1112,30 +1112,30 @@ struct _RTF_Info { ...@@ -1112,30 +1112,30 @@ struct _RTF_Info {
void RTFInit (RTF_Info *); void RTFInit (RTF_Info *);
void RTFDestroy(RTF_Info *info); void RTFDestroy(RTF_Info *info);
void RTFSetInputName (RTF_Info *, char *); void RTFSetInputName (RTF_Info *, const char *);
char *RTFGetInputName (RTF_Info *); char *RTFGetInputName (const RTF_Info *);
void RTFSetOutputName (RTF_Info *, char *); void RTFSetOutputName (RTF_Info *, const char *);
char *RTFGetOutputName (RTF_Info *); char *RTFGetOutputName (const RTF_Info *);
void RTFSetClassCallback (RTF_Info *, int, RTFFuncPtr); void RTFSetClassCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetClassCallback (RTF_Info *, int); RTFFuncPtr RTFGetClassCallback (const RTF_Info *, int);
void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr); void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetDestinationCallback (RTF_Info *, int); RTFFuncPtr RTFGetDestinationCallback (const RTF_Info *, int);
void RTFRead (RTF_Info *); void RTFRead (RTF_Info *);
int RTFGetToken (RTF_Info *); /* writer should rarely need this */ int RTFGetToken (RTF_Info *); /* writer should rarely need this */
void RTFUngetToken (RTF_Info *); void RTFUngetToken (RTF_Info *);
int RTFPeekToken (RTF_Info *); int RTFPeekToken (RTF_Info *);
void RTFSetToken (RTF_Info *, int, int, int, int, const char *); void RTFSetToken (RTF_Info *, int, int, int, int, const char *);
void RTFSetReadHook (RTF_Info *, RTFFuncPtr); void RTFSetReadHook (RTF_Info *, RTFFuncPtr);
RTFFuncPtr RTFGetReadHook (RTF_Info *); RTFFuncPtr RTFGetReadHook (const RTF_Info *);
void RTFRouteToken (RTF_Info *); void RTFRouteToken (RTF_Info *);
void RTFSkipGroup (RTF_Info *); void RTFSkipGroup (RTF_Info *);
void RTFExpandStyle (RTF_Info *, int); void RTFExpandStyle (RTF_Info *, int);
int RTFCheckCM (RTF_Info *, int, int); int RTFCheckCM (const RTF_Info *, int, int);
int RTFCheckCMM (RTF_Info *, int, int, int); int RTFCheckCMM (const RTF_Info *, int, int, int);
int RTFCheckMM (RTF_Info *, int, int); int RTFCheckMM (const RTF_Info *, int, int);
RTFFont *RTFGetFont (RTF_Info *, int); RTFFont *RTFGetFont (const RTF_Info *, int);
RTFColor *RTFGetColor (RTF_Info *, int); RTFColor *RTFGetColor (const RTF_Info *, int);
RTFStyle *RTFGetStyle (RTF_Info *, int); RTFStyle *RTFGetStyle (const RTF_Info *, int);
int RTFCharToHex ( char); int RTFCharToHex ( char);
int RTFHexToChar ( int ); int RTFHexToChar ( int );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment