diff --git a/ChangeLog b/ChangeLog index fc3c753..664e1bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +# +# Version 0.7.8, 2011-07-10 +# + +2011-07-10 Thomas Pircher + + * crc_symtable.py: + When generating C code for the C89 or ANSI standard, don't include . + This closes issue 3338930 + + * crc_symtable.py: + If no output file name is given while generating a C file, then pycrc will + #include a hypothetical pycrc.h file instead of a stdout.h file. + Also, added a comment on that line to make debugging easier. + Closes issue 3325109. + + * crc_symtable.py: + Removed unused variable "this_option_optind" in the generated option parser. + # # Version 0.7.7, 2011-02-11 # diff --git a/crc_opt.py b/crc_opt.py index 89c99c1..b1f9b85 100644 --- a/crc_opt.py +++ b/crc_opt.py @@ -50,7 +50,7 @@ class Options(object): # Program details ProgramName = "pycrc" - Version = "0.7.7" + Version = "0.7.8" VersionStr = "%s v%s" % (ProgramName, Version) WebAddress = "http://www.tty1.net/pycrc/" diff --git a/crc_symtable.py b/crc_symtable.py index dfcd2ff..0e3c233 100644 --- a/crc_symtable.py +++ b/crc_symtable.py @@ -66,12 +66,12 @@ def __init__(self, opt): self.table["program_version"] = self.opt.VersionStr self.table["program_url"] = self.opt.WebAddress if self.opt.OutputFile == None: - self.table["filename"] = "stdout" + self.table["filename"] = "pycrc_stdout" else: self.table["filename"] = self.opt.OutputFile if self.opt.OutputFile == None: - self.table["header_filename"] = "stdout.h" + self.table["header_filename"] = "pycrc_stdout.h" elif self.opt.OutputFile[-2:] == ".c": self.table["header_filename"] = self.opt.OutputFile[0:-1] + "h" else: @@ -261,8 +261,10 @@ def __getTerminal(self, id): $if ($include_file != Undefined) {: #include $include_file :} -#include #include +$if ($c_std != C89) {: +#include +:} $if ($undefined_parameters == True and $c_std != C89) {: #include :} @@ -522,7 +524,7 @@ def __getTerminal(self, id): $if ($include_file != Undefined) {: #include $include_file :} -#include "$header_filename" +#include "$header_filename" /* include the header file generated with pycrc */ #include #include $if ($undefined_parameters == True or $crc_algorithm == "bit-by-bit" or $crc_algorithm == "bit-by-bit-fast") {: @@ -997,7 +999,6 @@ def __getTerminal(self, id): static int get_config(int argc, char *argv[]$if ($undefined_parameters == True) {:, $cfg_t *cfg:}) { int c; - int this_option_optind; int option_index; static struct option long_options[] = { $if ($crc_width == Undefined) {: @@ -1027,7 +1028,6 @@ def __getTerminal(self, id): }; while (1) { - this_option_optind = optind ? optind : 1; option_index = 0; c = getopt_long (argc, argv, "w:p:n:i:u:o:s:vt", long_options, &option_index); @@ -1165,7 +1165,7 @@ def __pretty_hdrprotection(self): else: tr_str += '_' if self.opt.OutputFile == None: - out_str = "stdout" + out_str = "pycrc_stdout" else: out_str = self.opt.OutputFile out_str = os.path.basename(out_str) diff --git a/test/main.c b/test/main.c index 7548dcf..a752dba 100644 --- a/test/main.c +++ b/test/main.c @@ -87,7 +87,6 @@ crc_t xtoi(const char *str) int get_config(int argc, char *argv[], crc_cfg_t *cfg) { int c; - int this_option_optind; int option_index; static struct option long_options[] = { {"width", 1, 0, 'w'}, @@ -103,7 +102,6 @@ int get_config(int argc, char *argv[], crc_cfg_t *cfg) }; while (1) { - this_option_optind = optind ? optind : 1; option_index = 0; c = getopt_long (argc, argv, "w:p:ni:uo:v", long_options, &option_index);