]> git.sesse.net Git - vlc/blobdiff - modules/visualization/galaktos/preset.c
Test pointers against NULL instead of 0.
[vlc] / modules / visualization / galaktos / preset.c
index 64a4ce98cf6f9fb5c5eca6509254d5f6951db2d8..e7aea345ddb48ca71c10b8c33d2c4578712eb47d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
+#include <vlc_common.h>
+#include <vlc_charset.h>
 
-#include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <dirent.h>
 #include <time.h>
 #include "common.h"
@@ -382,7 +385,6 @@ int loadPresetByFile(char * filename) {
 int init_idle_preset() {
 
   preset_t * preset;
-  int i;
 
     /* Initialize idle preset struct */
   if ((preset = (preset_t*)malloc(sizeof(preset_t))) == NULL)
@@ -520,7 +522,7 @@ int load_preset_file(char * pathname, preset_t * preset) {
          return FAILURE;
   
   /* Open the file corresponding to pathname */
-  if ((fs = utf8_fopen(pathname, "r")) == 0) {
+  if ((fs = utf8_fopen(pathname, "r")) == NULL) {
     if (PRESET_DEBUG) printf("load_preset_file: loading of file %s failed!\n", pathname);
     return ERROR;      
   }
@@ -738,7 +740,6 @@ void reloadPerFrame(char * s, preset_t * preset) {
 preset_t * load_preset(char * pathname) {
 
   preset_t * preset;
-  int i;
 
   /* Initialize preset struct */
   if ((preset = (preset_t*)malloc(sizeof(preset_t))) == NULL)
@@ -792,7 +793,7 @@ void savePreset(char * filename) {
     return;
   
   /* Open the file corresponding to pathname */
-  if ((fs = utf8_fopen(filename, "w+")) == 0) {
+  if ((fs = utf8_fopen(filename, "w+")) == NULL) {
     if (PRESET_DEBUG) printf("savePreset: failed to create filename \"%s\"!\n", filename);
     return;    
   }
@@ -889,7 +890,7 @@ void write_init(init_cond_t * init_cond) {
   else if (init_cond->param->type == P_TYPE_DOUBLE)
   {
     lldiv_t div = lldiv( init_cond->init_val.double_val * 1000000,1000000 );
-    sprintf(s, "%s="I64Fd".%06u\n", init_cond->param->name, div.quot,
+    sprintf(s, "%s=%"PRId64".%06u\n", init_cond->param->name, div.quot,
                     (unsigned int) div.rem );
   }