Reformat whole codebase with astyle.options (#128)
[openjpeg.git] / src / bin / jpip / opj_jpip_test.c
index 1b4fc1c6e84be7e323fc4e0367ab97129a32090c..f86ec4a633ce882f9cff52c9223d511002ca1f5e 100644 (file)
 int
 main(int argc, char *argv[])
 {
-  int fd;
-  index_t *jp2idx;
-  if( argc < 2 ) return 1;
-  
-  if( (fd = open( argv[1], O_RDONLY)) == -1){
-    fprintf( stderr, "Error: Target %s not found\n", argv[1]);
-    return -1;
-  }
+    int fd;
+    index_t *jp2idx;
+    if (argc < 2) {
+        return 1;
+    }
 
-  if( !(jp2idx = get_index_from_JP2file( fd))){
-    fprintf( stderr, "JP2 file broken\n");
-    return -1;
-  }
-  
-  output_index( jp2idx);
-  destroy_index( &jp2idx);
-  close(fd);
+    if ((fd = open(argv[1], O_RDONLY)) == -1) {
+        fprintf(stderr, "Error: Target %s not found\n", argv[1]);
+        return -1;
+    }
 
-  return 0;
+    if (!(jp2idx = get_index_from_JP2file(fd))) {
+        fprintf(stderr, "JP2 file broken\n");
+        return -1;
+    }
+
+    output_index(jp2idx);
+    destroy_index(&jp2idx);
+    close(fd);
+
+    return 0;
 } /* main */