Fix copyright
[yaffs2.git] / utils / mkyaffsimage.c
index 49636b1635d63de1c2755b36edb4678743d992e6..c367bf6ceb927bcb3a529b3ce48f84e5254ea23f 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  * Nick Bane modifications flagged NCB
@@ -45,8 +44,7 @@ typedef struct
 
 
 static objItem obj_list[MAX_OBJECTS];
-static int n_obj = 0;
-static int obj_id = YAFFS_NOBJECT_BUCKETS + 1;
+static int obj_alloc_id = YAFFS_NOBJECT_BUCKETS + 1;
 
 static int n_obj, nDirectories, nPages;
 
@@ -132,8 +130,8 @@ static u16 yaffs_calc_name_sum(const char *name)
 
 static void yaffs_calc_ecc(const u8 *data, struct yaffs_spare *spare)
 {
-       yaffs_ecc_cacl(data , spare->ecc1);
-       yaffs_ecc_cacl(&data[256] , spare->ecc2);
+       yaffs_ecc_calc(data , spare->ecc1);
+       yaffs_ecc_calc(&data[256] , spare->ecc2);
 }
 
 static void yaffs_calc_tags_ecc(struct yaffs_tags *tags)
@@ -283,7 +281,7 @@ static void object_header_little_to_big_endian(struct yaffs_obj_hdr* oh)
     oh->yst_mtime = SWAP32(oh->yst_mtime);
     oh->yst_ctime = SWAP32(oh->yst_ctime);
 
-    oh->file_size = SWAP32(oh->file_size); // Aiee. An int... signed, at that!
+    oh->file_size_low = SWAP32(oh->file_size_low); // Aiee. An int... signed, at that!
     oh->equiv_id = SWAP32(oh->equiv_id);
     // alias  - char array.
     oh->yst_rdev = SWAP32(oh->yst_rdev);
@@ -334,7 +332,7 @@ static int write_object_header(int obj_id, enum yaffs_obj_type t, struct stat *s
        
        if(t == YAFFS_OBJECT_TYPE_FILE)
        {
-               oh->file_size = s->st_size;
+               oh->file_size_low = s->st_size;
        }
        
        if(t == YAFFS_OBJECT_TYPE_HARDLINK)
@@ -394,7 +392,7 @@ static int process_directory(int parent, const char *path)
                                    S_ISSOCK(stats.st_mode))
                                {
                                
-                                       newObj = obj_id++;
+                                       newObj = obj_alloc_id++;
                                        n_obj++;
                                        
                                        printf("Object %d, %s is a ",newObj,full_name);