OSDN Git Service

Merge branch 'branch_0.12.0' into branch_0.12.0-svn
[modchxj/mod_chxj.git] / src / chxj_img_conv.c
index e146702..1d1ab54 100644 (file)
@@ -1,6 +1,6 @@
 /*
+ * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
- * Copyright (C) 2005 Atsushi Konno All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include "mod_chxj.h"
 
 
-char* 
+char 
 chxj_img_conv(
-  request_rec*  r, 
-  device_tablespec, 
-  const char*   s)
+  request_rec  *r, 
+  device_table *spec, 
+  const char   *s)
 {
-  char* dst;
-
-  dst = apr_pstrdup(r->pool, s);
-
+  char *dst = apr_pstrdup(r->pool, s);
   if (spec) {
     switch (spec->color) {
     case 2       : dst = apr_pstrcat(r->pool, dst,".10", NULL); break;
@@ -42,13 +39,13 @@ chxj_img_conv(
     if (spec->available_jpeg)
       return apr_pstrcat(r->pool, dst,".jpg", NULL);
 
-    if (spec->available_png != 0)
+    if (spec->available_png)
       return apr_pstrcat(r->pool, dst,".png", NULL);
 
-    if (spec->available_gif != 0)
+    if (spec->available_gif)
       return apr_pstrcat(r->pool, dst, ".gif", NULL);
 
-    if (spec->available_bmp4 != 0 || spec->available_bmp2 != 0)
+    if (spec->available_bmp4 || spec->available_bmp2)
       return apr_pstrcat(r->pool, dst, ".bmp", NULL);
   }