More warning fixes. Made private uiAttributeString functions const-correct to expose more potential issues later. Const-correctness and uiAttributeRetain() are going to be an issue...
This commit is contained in:
parent
115a60c950
commit
4bb6a56c99
|
@ -316,23 +316,23 @@ size_t uiAttributedStringGraphemeToByteIndex(uiAttributedString *s, size_t pos)
|
||||||
|
|
||||||
// helpers for platform-specific code
|
// helpers for platform-specific code
|
||||||
|
|
||||||
const uint16_t *uiprivAttributedStringUTF16String(uiAttributedString *s)
|
const uint16_t *uiprivAttributedStringUTF16String(const uiAttributedString *s)
|
||||||
{
|
{
|
||||||
return s->u16;
|
return s->u16;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t uiprivAttributedStringUTF16Len(uiAttributedString *s)
|
size_t uiprivAttributedStringUTF16Len(const uiAttributedString *s)
|
||||||
{
|
{
|
||||||
return s->u16len;
|
return s->u16len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO is this still needed given the below?
|
// TODO is this still needed given the below?
|
||||||
size_t uiprivAttributedStringUTF8ToUTF16(uiAttributedString *s, size_t n)
|
size_t uiprivAttributedStringUTF8ToUTF16(const uiAttributedString *s, size_t n)
|
||||||
{
|
{
|
||||||
return s->u8tou16[n];
|
return s->u8tou16[n];
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t *uiprivAttributedStringCopyUTF8ToUTF16Table(uiAttributedString *s, size_t *n)
|
size_t *uiprivAttributedStringCopyUTF8ToUTF16Table(const uiAttributedString *s, size_t *n)
|
||||||
{
|
{
|
||||||
size_t *out;
|
size_t *out;
|
||||||
size_t nbytes;
|
size_t nbytes;
|
||||||
|
@ -344,7 +344,7 @@ size_t *uiprivAttributedStringCopyUTF8ToUTF16Table(uiAttributedString *s, size_t
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t *uiprivAttributedStringCopyUTF16ToUTF8Table(uiAttributedString *s, size_t *n)
|
size_t *uiprivAttributedStringCopyUTF16ToUTF8Table(const uiAttributedString *s, size_t *n)
|
||||||
{
|
{
|
||||||
size_t *out;
|
size_t *out;
|
||||||
size_t nbytes;
|
size_t nbytes;
|
||||||
|
|
|
@ -29,11 +29,11 @@ extern void uiprivAttrListRemoveCharacters(uiprivAttrList *alist, size_t start,
|
||||||
extern void uiprivAttrListForEach(const uiprivAttrList *alist, const uiAttributedString *s, uiAttributedStringForEachAttributeFunc f, void *data);
|
extern void uiprivAttrListForEach(const uiprivAttrList *alist, const uiAttributedString *s, uiAttributedStringForEachAttributeFunc f, void *data);
|
||||||
|
|
||||||
// attrstr.c
|
// attrstr.c
|
||||||
extern const uint16_t *uiprivAttributedStringUTF16String(uiAttributedString *s);
|
extern const uint16_t *uiprivAttributedStringUTF16String(const uiAttributedString *s);
|
||||||
extern size_t uiprivAttributedStringUTF16Len(uiAttributedString *s);
|
extern size_t uiprivAttributedStringUTF16Len(const uiAttributedString *s);
|
||||||
extern size_t uiprivAttributedStringUTF8ToUTF16(uiAttributedString *s, size_t n);
|
extern size_t uiprivAttributedStringUTF8ToUTF16(const uiAttributedString *s, size_t n);
|
||||||
extern size_t *uiprivAttributedStringCopyUTF8ToUTF16Table(uiAttributedString *s, size_t *n);
|
extern size_t *uiprivAttributedStringCopyUTF8ToUTF16Table(const uiAttributedString *s, size_t *n);
|
||||||
extern size_t *uiprivAttributedStringCopyUTF16ToUTF8Table(uiAttributedString *s, size_t *n);
|
extern size_t *uiprivAttributedStringCopyUTF16ToUTF8Table(const uiAttributedString *s, size_t *n);
|
||||||
|
|
||||||
// per-OS graphemes.c/graphemes.cpp/graphemes.m/etc.
|
// per-OS graphemes.c/graphemes.cpp/graphemes.m/etc.
|
||||||
struct graphemes {
|
struct graphemes {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// 25 february 2018
|
// 25 february 2018
|
||||||
|
#include <stdlib.h>
|
||||||
#include "../ui.h"
|
#include "../ui.h"
|
||||||
#include "uipriv.h"
|
#include "uipriv.h"
|
||||||
#include "attrstr.h"
|
#include "attrstr.h"
|
||||||
|
|
|
@ -457,7 +457,6 @@ CFAttributedStringRef uiprivAttributedStringToCFAttributedString(uiDrawTextLayou
|
||||||
{
|
{
|
||||||
CFStringRef cfstr;
|
CFStringRef cfstr;
|
||||||
CFMutableDictionaryRef defaultAttrs;
|
CFMutableDictionaryRef defaultAttrs;
|
||||||
CTFontRef defaultCTFont;
|
|
||||||
CTParagraphStyleRef ps;
|
CTParagraphStyleRef ps;
|
||||||
CFAttributedStringRef base;
|
CFAttributedStringRef base;
|
||||||
CFMutableAttributedStringRef mas;
|
CFMutableAttributedStringRef mas;
|
||||||
|
|
Loading…
Reference in New Issue