riched20: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-08-14 21:30:13 +01:00 committed by Alexandre Julliard
parent 80a1a2f135
commit da68f3943f
2 changed files with 28 additions and 28 deletions

View file

@ -92,7 +92,7 @@ static void RTFPutCodePageChar(RTF_Info *info, int c);
/*
* 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;
@ -254,7 +254,7 @@ void RTFInit(RTF_Info *info)
* 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);
if (info->inputName == NULL)
@ -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);
}
void RTFSetOutputName(RTF_Info *info, char *name)
void RTFSetOutputName(RTF_Info *info, const char *name)
{
info->outputName = RTFStrSave (name);
if (info->outputName == NULL)
@ -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);
}
@ -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)
return info->ccb[class];
@ -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)
return info->dcb[dest];
@ -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);
}
@ -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;
@ -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;
@ -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;
@ -2373,19 +2373,19 @@ static int Hash(const char *s)
* 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);
}
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);
}
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);
}
@ -2661,7 +2661,7 @@ RTFFlushUnicodeOutputBuffer(RTF_Info *info)
}
static void
RTFPutUnicodeString(RTF_Info *info, WCHAR *string, int length)
RTFPutUnicodeString(RTF_Info *info, const WCHAR *string, int length)
{
if (info->dwCPOutputCount)
RTFFlushCPOutputBuffer(info);

View file

@ -1112,30 +1112,30 @@ struct _RTF_Info {
void RTFInit (RTF_Info *);
void RTFDestroy(RTF_Info *info);
void RTFSetInputName (RTF_Info *, char *);
char *RTFGetInputName (RTF_Info *);
void RTFSetOutputName (RTF_Info *, char *);
char *RTFGetOutputName (RTF_Info *);
void RTFSetInputName (RTF_Info *, const char *);
char *RTFGetInputName (const RTF_Info *);
void RTFSetOutputName (RTF_Info *, const char *);
char *RTFGetOutputName (const RTF_Info *);
void RTFSetClassCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetClassCallback (RTF_Info *, int);
RTFFuncPtr RTFGetClassCallback (const RTF_Info *, int);
void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr);
RTFFuncPtr RTFGetDestinationCallback (RTF_Info *, int);
RTFFuncPtr RTFGetDestinationCallback (const RTF_Info *, int);
void RTFRead (RTF_Info *);
int RTFGetToken (RTF_Info *); /* writer should rarely need this */
void RTFUngetToken (RTF_Info *);
int RTFPeekToken (RTF_Info *);
void RTFSetToken (RTF_Info *, int, int, int, int, const char *);
void RTFSetReadHook (RTF_Info *, RTFFuncPtr);
RTFFuncPtr RTFGetReadHook (RTF_Info *);
RTFFuncPtr RTFGetReadHook (const RTF_Info *);
void RTFRouteToken (RTF_Info *);
void RTFSkipGroup (RTF_Info *);
void RTFExpandStyle (RTF_Info *, int);
int RTFCheckCM (RTF_Info *, int, int);
int RTFCheckCMM (RTF_Info *, int, int, int);
int RTFCheckMM (RTF_Info *, int, int);
RTFFont *RTFGetFont (RTF_Info *, int);
RTFColor *RTFGetColor (RTF_Info *, int);
RTFStyle *RTFGetStyle (RTF_Info *, int);
int RTFCheckCM (const RTF_Info *, int, int);
int RTFCheckCMM (const RTF_Info *, int, int, int);
int RTFCheckMM (const RTF_Info *, int, int);
RTFFont *RTFGetFont (const RTF_Info *, int);
RTFColor *RTFGetColor (const RTF_Info *, int);
RTFStyle *RTFGetStyle (const RTF_Info *, int);
int RTFCharToHex ( char);
int RTFHexToChar ( int );