From 6a2018fe13ad35537f8758f005b0cb3dc3bb0997 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Aug 2012 10:44:10 +0000 Subject: code cleanup: minor changes to last commit. --- source/blender/blenkernel/BKE_packedFile.h | 2 +- source/blender/blenkernel/intern/font.c | 13 +++++-------- source/blender/blenkernel/intern/packedFile.c | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index ecbd2e7536b..603cb1f22a6 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -43,7 +43,7 @@ struct ReportList; struct VFont; /* pack */ -struct PackedFile *dupPackedFileMemory(const struct PackedFile *pf_src); +struct PackedFile *dupPackedFile(const struct PackedFile *pf_src); struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase); struct PackedFile *newPackedFileMemory(void *mem, int memlen); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 8689d6648a9..0ffd68c9079 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -60,7 +60,6 @@ #include "BKE_curve.h" #include "BKE_displist.h" -//static ListBase ttfdata = {NULL, NULL}; /* The vfont code */ void BKE_vfont_free_data(struct VFont *vfont) @@ -149,7 +148,7 @@ static VFontData *vfont_get_data(Main *bmain, VFont *vfont) /* We need to copy a tmp font to memory unless it is already there */ if (vfont->temp_pf == NULL) { - vfont->temp_pf = dupPackedFileMemory(pf); + vfont->temp_pf = dupPackedFile(pf); } } else { @@ -237,8 +236,6 @@ VFont *BKE_vfont_load(Main *bmain, const char *name) if (!vfont || vfont->packedfile != pf) { freePackedFile(pf); } - - //XXX waitcursor(0); } return vfont; @@ -248,13 +245,13 @@ static VFont *which_vfont(Curve *cu, CharInfo *info) { switch (info->flag & (CU_CHINFO_BOLD | CU_CHINFO_ITALIC)) { case CU_CHINFO_BOLD: - if (cu->vfontb) return(cu->vfontb); else return(cu->vfont); + return cu->vfontb ? cu->vfontb : cu->vfont; case CU_CHINFO_ITALIC: - if (cu->vfonti) return(cu->vfonti); else return(cu->vfont); + return cu->vfonti ? cu->vfonti : cu->vfont; case (CU_CHINFO_BOLD | CU_CHINFO_ITALIC): - if (cu->vfontbi) return(cu->vfontbi); else return(cu->vfont); + return cu->vfontbi ? cu->vfontbi : cu->vfont; default: - return(cu->vfont); + return cu->vfont; } } diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index ed2f4af0c51..9787a5025f7 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -159,7 +159,7 @@ void freePackedFile(PackedFile *pf) printf("freePackedFile: Trying to free a NULL pointer\n"); } -PackedFile *dupPackedFileMemory(const PackedFile *pf_src) +PackedFile *dupPackedFile(const PackedFile *pf_src) { PackedFile *pf_dst; -- cgit v1.2.3