~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/makesdna/intern/makesdna.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: makesdna.c,v 1.8 2004/03/20 22:55:38 zuster Exp $
 
2
 * $Id: makesdna.c,v 1.14 2005/05/02 13:28:12 ton Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
49
49
 * numbers give more output.
50
50
 * */
51
51
 
52
 
#define DNA_VERSION_DATE "$Id: makesdna.c,v 1.8 2004/03/20 22:55:38 zuster Exp $"
 
52
#define DNA_VERSION_DATE "$Id: makesdna.c,v 1.14 2005/05/02 13:28:12 ton Exp $"
53
53
 
54
54
#include <string.h>
55
55
#include <stdlib.h>
95
95
        "DNA_meshdata_types.h",
96
96
        "DNA_lattice_types.h",  
97
97
        "DNA_object_types.h",
 
98
        "DNA_object_force.h",
98
99
        "DNA_world_types.h",
99
100
        "DNA_radio_types.h",
100
101
        "DNA_scene_types.h",
464
465
        return newlen;
465
466
}
466
467
 
467
 
void *read_file_data(char *filename, int *len_r)
 
468
static void *read_file_data(char *filename, int *len_r)
468
469
{
469
470
#ifdef WIN32
470
471
        FILE *fp= fopen(filename, "rb");
718
719
                                                
719
720
                                                /* 2-4 aligned/ */
720
721
                                                if(typelens[type]>3 && (len % 4) ) {
721
 
                                                        printf("Align 4 error in struct: %s %s\n", types[structtype], cp);
 
722
                                                        printf("Align 4 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%4);
 
723
                                                        dna_error = 1;
722
724
                                                }
723
725
                                                else if(typelens[type]==2 && (len % 2) ) {
724
 
                                                        printf("Align 2 error in struct: %s %s\n", types[structtype], cp);
 
726
                                                        printf("Align 2 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%2);
 
727
                                                        dna_error = 1;
725
728
                                                }
726
729
 
727
730
                                                len += mul*typelens[type];
743
746
                                        // has_pointer is set or alphalen != len
744
747
                                        if (has_pointer || alphalen != len) {
745
748
                                                if (alphalen % 8) {
746
 
                                                        printf("Sizeerror in struct: %s\n", types[structtype]);
 
749
                                                        printf("Sizeerror in struct: %s (add %d bytes)\n", types[structtype], alphalen%8);
747
750
                                                        dna_error = 1;
748
751
                                                }
749
752
                                        }
 
753
                                        
 
754
                                        if(len % 4) {
 
755
                                                printf("Sizeerror in struct: %s (add %d bytes)\n", types[structtype], len%4);
 
756
                                                dna_error = 1;
 
757
                                        }
 
758
                                        
750
759
                                }
751
760
                        }
752
761
                }
1039
1048
 
1040
1049
/* ************************* END MAKE DNA ********************** */
1041
1050
 
1042
 
void make_bad_file(char *file)
 
1051
static void make_bad_file(char *file)
1043
1052
{
1044
1053
        FILE *fp= fopen(file, "w");
1045
1054
        fprintf(fp, "ERROR! Cannot make correct DNA.c file, STUPID!\n");
1101
1110
#include "DNA_meshdata_types.h"
1102
1111
#include "DNA_lattice_types.h"  
1103
1112
#include "DNA_object_types.h"
 
1113
#include "DNA_object_force.h"
1104
1114
#include "DNA_world_types.h"
1105
1115
#include "DNA_radio_types.h"
1106
1116
#include "DNA_scene_types.h"