aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-05-02 07:19:02 (GMT)
committerfluxgen <fluxgen>2002-05-02 07:19:02 (GMT)
commit3cc006d7b57fa982ae10087c36616f4c8a511c0a (patch)
treec088314f0faf9b5e6227d71827033d5278fd5e1d
parent5e9343fc7f5395937d342f9cb4110a3feff73200 (diff)
downloadfluxbox_paul-3cc006d7b57fa982ae10087c36616f4c8a511c0a.zip
fluxbox_paul-3cc006d7b57fa982ae10087c36616f4c8a511c0a.tar.bz2
removed NULL
-rw-r--r--src/Font.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Font.cc b/src/Font.cc
index dd1dc2a..0ca7d5a 100644
--- a/src/Font.cc
+++ b/src/Font.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: Font.cc,v 1.5 2002/04/26 09:32:20 fluxgen Exp $ 22//$Id: Font.cc,v 1.6 2002/05/02 07:19:02 fluxgen Exp $
23 23
24 24
25#include "Font.hh" 25#include "Font.hh"
@@ -164,9 +164,9 @@ XFontSet Font::createFontSet(Display *display, const char *fontname) {
164 } 164 }
165 165
166 getFontElement(fontname, weight, FONT_ELEMENT_SIZE, 166 getFontElement(fontname, weight, FONT_ELEMENT_SIZE,
167 "-medium-", "-bold-", "-demibold-", "-regular-", NULL); 167 "-medium-", "-bold-", "-demibold-", "-regular-", 0);
168 getFontElement(fontname, slant, FONT_ELEMENT_SIZE, 168 getFontElement(fontname, slant, FONT_ELEMENT_SIZE,
169 "-r-", "-i-", "-o-", "-ri-", "-ro-", NULL); 169 "-r-", "-i-", "-o-", "-ri-", "-ro-", 0);
170 getFontSize(fontname, &pixel_size); 170 getFontSize(fontname, &pixel_size);
171 171
172 if (! strcmp(weight, "*")) 172 if (! strcmp(weight, "*"))
@@ -207,7 +207,7 @@ const char *Font::getFontElement(const char *pattern, char *buf, int bufsiz, ...
207 va_start(va, bufsiz); 207 va_start(va, bufsiz);
208 buf[bufsiz-1] = 0; 208 buf[bufsiz-1] = 0;
209 buf[bufsiz-2] = '*'; 209 buf[bufsiz-2] = '*';
210 while((v = va_arg(va, char *)) != NULL) { 210 while((v = va_arg(va, char *)) != 0) {
211 p = StringUtil::strcasestr(pattern, v); 211 p = StringUtil::strcasestr(pattern, v);
212 if (p) { 212 if (p) {
213 std::strncpy(buf, p+1, bufsiz-2); 213 std::strncpy(buf, p+1, bufsiz-2);
@@ -219,7 +219,7 @@ const char *Font::getFontElement(const char *pattern, char *buf, int bufsiz, ...
219 } 219 }
220 va_end(va); 220 va_end(va);
221 std::strncpy(buf, "*", bufsiz); 221 std::strncpy(buf, "*", bufsiz);
222 return NULL; 222 return 0;
223} 223}
224 224
225const char *Font::getFontSize(const char *pattern, int *size) { 225const char *Font::getFontSize(const char *pattern, int *size) {
@@ -229,22 +229,22 @@ const char *Font::getFontSize(const char *pattern, int *size) {
229 229
230 for (p=pattern; 1; p++) { 230 for (p=pattern; 1; p++) {
231 if (!*p) { 231 if (!*p) {
232 if (p2!=NULL && n>1 && n<72) { 232 if (p2!=0 && n>1 && n<72) {
233 *size = n; return p2+1; 233 *size = n; return p2+1;
234 } else { 234 } else {
235 *size = 16; return NULL; 235 *size = 16; return 0;
236 } 236 }
237 } else if (*p=='-') { 237 } else if (*p=='-') {
238 if (n>1 && n<72 && p2!=NULL) { 238 if (n>1 && n<72 && p2!=0) {
239 *size = n; 239 *size = n;
240 return p2+1; 240 return p2+1;
241 } 241 }
242 p2=p; n=0; 242 p2=p; n=0;
243 } else if (*p>='0' && *p<='9' && p2!=NULL) { 243 } else if (*p>='0' && *p<='9' && p2!=0) {
244 n *= 10; 244 n *= 10;
245 n += *p-'0'; 245 n += *p-'0';
246 } else { 246 } else {
247 p2=NULL; n=0; 247 p2=0; n=0;
248 } 248 }
249 } 249 }
250} 250}