Daily Diary

23 September, 2013
Ran Cppcheck tool and got the following:

[src/bits.c:276]: (warning) Casting between integer* and double* which have an incompatible binary data representation.
[src/bits.c:409]: (portability) Casting from double* to integer* is not portable due to different binary data representations on different platforms.
[src/bits.c:645]: (portability) Casting from double* to integer* is not portable due to different binary data representations on different platforms.
[src/bits.c:646]: (portability) Casting from double* to integer* is not portable due to different binary data representations on different platforms.
[src/bits.c:106]: (style) The scope of the variable 'mask' can be reduced.
[src/bits.c:197]: (style) The scope of the variable 'byte' can be reduced.
[src/bits.c:197]: (style) The scope of the variable 'remainder' can be reduced.
[src/bits.c:391]: (style) The scope of the variable 'res' can be reduced.
[src/bits.c:637]: (style) The scope of the variable 'uchar_value' can be reduced.
[src/bits.c:638]: (style) The scope of the variable 'uint_default' can be reduced.
[src/bits.c:638]: (style) The scope of the variable 'uint_value' can be reduced.
[src/bits.c:164]: (style) Variable 'remainder1' is assigned a value that is never used.
[src/bits.c:165]: (style) Variable 'remainder2' is assigned a value that is never used.
[src/bits.c:733]: (style) Unused variable: j
[src/bits.c:1048]: (style) Unused variable: k
[src/bits.c:1078]: (style) Unused variable: j
[src/classes.c:122] -> [src/classes.c:123]: (performance) Variable 'c' is reassigned a value before the old one has been used.
[src/classes.c:123] -> [src/classes.c:124]: (performance) Variable 'c' is reassigned a value before the old one has been used.
[src/classes.c:151] -> [src/classes.c:152]: (performance) Variable 'unknown' is reassigned a value before the old one has been used.
[src/classes.c:112]: (style) The scope of the variable 'c' can be reduced.
[src/classes.c:48]: (style) Variable 'i' is assigned a value that is never used.
[src/classes.c:124]: (style) Variable 'c' is assigned a value that is never used.
[src/classes.c:149]: (style) Variable 'dwg_version' is assigned a value that is never used.
[src/classes.c:150]: (style) Variable 'maint_version' is assigned a value that is never used.
[src/classes.c:121]: (style) Variable 'max_num' is assigned a value that is never used.
[src/classes.c:148]: (style) Variable 'num_objects' is assigned a value that is never used.
[src/classes.c:152]: (style) Variable 'unknown' is assigned a value that is never used.
[src/classes.c:216]: (style) Variable 'unknown' is assigned a value that is never used.
[src/classes.c:240]: (style) Variable 'dwg_version' is assigned a value that is never used.
[src/classes.c:241]: (style) Variable 'maint_version' is assigned a value that is never used.
[src/classes.c:239]: (style) Variable 'num_objects' is assigned a value that is never used.
[src/classes.c:242]: (style) Variable 'unknown1' is assigned a value that is never used.
[src/classes.c:243]: (style) Variable 'unknown2' is assigned a value that is never used.
[src/compress_decompress.c:29]: (style) The scope of the variable 'total' can be reduced.
[src/decode.c:455]: (warning) %d in format string (no. 1) requires a signed integer given in the argument list.
[src/decode.c:267]: (warning) Redundant assignment of 'flags' to itself.
[src/decode.c:240]: (style) The scope of the variable 'color_mode' can be reduced.
[src/decode.c:240]: (style) The scope of the variable 'color' can be reduced.
[src/decode.c:241]: (style) The scope of the variable 'index' can be reduced.
[src/decode.c:242]: (style) The scope of the variable 'flags' can be reduced.
[src/decode.c:243]: (style) The scope of the variable 'transparency' can be reduced.
[src/decode.c:590]: (style) The scope of the variable 'codepage' can be reduced.
[src/decode.c:274]: (style) Variable 'color' is assigned a value that is never used.
[src/decode.c:250]: (style) Variable 'index' is assigned a value that is never used.
[src/decode.c:270]: (style) Variable 'transparency' is assigned a value that is never used.
[src/decode.c:260]: (style) Variable 'c1' is assigned a value that is never used.
[src/decode.c:261]: (style) Variable 'c2' is assigned a value that is never used.
[src/decode.c:262]: (style) Variable 'c3' is assigned a value that is never used.
[src/decode.c:263]: (style) Variable 'c4' is assigned a value that is never used.
[src/decode.c:264]: (style) Variable 'name' is assigned a value that is never used.
[src/decode.c:471]: (style) Unused variable: i
[src/decode.c:589]: (style) Unused variable: group_code
[src/decode.c:589]: (style) Unused variable: hdl
[src/decode.c:612]: (style) Variable 'codepage' is assigned a value that is never used.
[src/decode_r13_r15.c:97] -> [src/decode_r13_r15.c:100]: (performance) Variable 'pvz' is reassigned a value before the old one has been used.
[src/decode_r13_r15.c:142] -> [src/decode_r13_r15.c:145]: (performance) Variable 'pvz' is reassigned a value before the old one has been used.
[src/decode_r13_r15.c:169]: (style) Variable 'ckr' is assigned a value that is never used.
[src/decode_r13_r15.c:145]: (style) Variable 'pvz' is assigned a value that is never used.
[src/decode_r13_r15.c:96]: (style) Variable 'pvzadr' is assigned a value that is never used.
[src/decode_r2007.c:358]: (style) The scope of the variable 'hisize' can be reduced.
[src/decode_r2007.c:252]: (style) Variable 'index' is assigned a value that is never used.
[src/decode_r2007.c:341]: (style) Variable 'seqence_crc' is assigned a value that is never used.
[src/decode_r2007.c:342]: (style) Variable 'seqence_key' is assigned a value that is never used.
[src/decode_r2007.c:343]: (style) Variable 'compr_crc' is assigned a value that is never used.
[src/dwg.c:183]: (warning) %i in format string (no. 1) requires a signed integer given in the argument list.
[src/dwg.c:39]: (style) Unused variable: sign
[src/header_variables.spec:214]: (warning) Redundant assignment of 'c1' to itself.
[src/dwg.spec:354]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:472]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:673]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:706]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:1027]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:1055]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:2727]: (style) The scope of the variable 'rcount' can be reduced.
[src/dwg.spec:2957]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:2995]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:3769]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:50]: (style) Unused variable: vcount
[src/dwg.spec:50]: (style) Unused variable: rcount
[src/dwg.spec:50]: (style) Unused variable: rcount2
[src/dwg.spec:50]: (style) Unused variable: rcount3
[src/dwg.spec:50]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:50]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.spec:57]: (style) Unused variable: vcount
[src/dwg.spec:57]: (style) Unused variable: rcount
[src/dwg.spec:57]: (style) Unused variable: rcount2
[src/dwg.spec:57]: (style) Unused variable: rcount3
[src/dwg.spec:57]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:141]: (style) Unused variable: vcount
[src/dwg.spec:141]: (style) Unused variable: rcount
[src/dwg.spec:141]: (style) Unused variable: rcount2
[src/dwg.spec:141]: (style) Unused variable: rcount3
[src/dwg.spec:141]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:235]: (style) Unused variable: vcount
[src/dwg.spec:235]: (style) Unused variable: rcount
[src/dwg.spec:235]: (style) Unused variable: rcount2
[src/dwg.spec:235]: (style) Unused variable: rcount3
[src/dwg.spec:235]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:331]: (style) Unused variable: vcount
[src/dwg.spec:331]: (style) Unused variable: rcount
[src/dwg.spec:331]: (style) Unused variable: rcount2
[src/dwg.spec:331]: (style) Unused variable: rcount3
[src/dwg.spec:331]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:340]: (style) Unused variable: vcount
[src/dwg.spec:340]: (style) Unused variable: rcount
[src/dwg.spec:340]: (style) Unused variable: rcount2
[src/dwg.spec:340]: (style) Unused variable: rcount3
[src/dwg.spec:340]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:340]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.spec:347]: (style) Unused variable: vcount
[src/dwg.spec:347]: (style) Unused variable: rcount
[src/dwg.spec:347]: (style) Unused variable: rcount2
[src/dwg.spec:347]: (style) Unused variable: rcount3
[src/dwg.spec:347]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:347]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.spec:354]: (style) Unused variable: rcount
[src/dwg.spec:354]: (style) Unused variable: rcount2
[src/dwg.spec:354]: (style) Unused variable: rcount3
[src/dwg.spec:354]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:472]: (style) Unused variable: rcount
[src/dwg.spec:472]: (style) Unused variable: rcount2
[src/dwg.spec:472]: (style) Unused variable: rcount3
[src/dwg.spec:472]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:583]: (style) Unused variable: vcount
[src/dwg.spec:583]: (style) Unused variable: rcount
[src/dwg.spec:583]: (style) Unused variable: rcount2
[src/dwg.spec:583]: (style) Unused variable: rcount3
[src/dwg.spec:583]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:631]: (style) Unused variable: vcount
[src/dwg.spec:631]: (style) Unused variable: rcount
[src/dwg.spec:631]: (style) Unused variable: rcount2
[src/dwg.spec:631]: (style) Unused variable: rcount3
[src/dwg.spec:631]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:641]: (style) Unused variable: vcount
[src/dwg.spec:641]: (style) Unused variable: rcount
[src/dwg.spec:641]: (style) Unused variable: rcount2
[src/dwg.spec:641]: (style) Unused variable: rcount3
[src/dwg.spec:641]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:651]: (style) Unused variable: vcount
[src/dwg.spec:651]: (style) Unused variable: rcount
[src/dwg.spec:651]: (style) Unused variable: rcount2
[src/dwg.spec:651]: (style) Unused variable: rcount3
[src/dwg.spec:651]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:661]: (style) Unused variable: vcount
[src/dwg.spec:661]: (style) Unused variable: rcount
[src/dwg.spec:661]: (style) Unused variable: rcount2
[src/dwg.spec:661]: (style) Unused variable: rcount3
[src/dwg.spec:661]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:673]: (style) Unused variable: rcount
[src/dwg.spec:673]: (style) Unused variable: rcount2
[src/dwg.spec:673]: (style) Unused variable: rcount3
[src/dwg.spec:673]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:706]: (style) Unused variable: rcount
[src/dwg.spec:706]: (style) Unused variable: rcount2
[src/dwg.spec:706]: (style) Unused variable: rcount3
[src/dwg.spec:706]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:734]: (style) Unused variable: vcount
[src/dwg.spec:734]: (style) Unused variable: rcount
[src/dwg.spec:734]: (style) Unused variable: rcount2
[src/dwg.spec:734]: (style) Unused variable: rcount3
[src/dwg.spec:734]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:748]: (style) Unused variable: vcount
[src/dwg.spec:748]: (style) Unused variable: rcount
[src/dwg.spec:748]: (style) Unused variable: rcount2
[src/dwg.spec:748]: (style) Unused variable: rcount3
[src/dwg.spec:748]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:760]: (style) Unused variable: vcount
[src/dwg.spec:760]: (style) Unused variable: rcount
[src/dwg.spec:760]: (style) Unused variable: rcount2
[src/dwg.spec:760]: (style) Unused variable: rcount3
[src/dwg.spec:760]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:842]: (style) Unused variable: vcount
[src/dwg.spec:842]: (style) Unused variable: rcount
[src/dwg.spec:842]: (style) Unused variable: rcount2
[src/dwg.spec:842]: (style) Unused variable: rcount3
[src/dwg.spec:842]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:858]: (style) Unused variable: vcount
[src/dwg.spec:858]: (style) Unused variable: rcount
[src/dwg.spec:858]: (style) Unused variable: rcount2
[src/dwg.spec:858]: (style) Unused variable: rcount3
[src/dwg.spec:858]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:875]: (style) Unused variable: vcount
[src/dwg.spec:875]: (style) Unused variable: rcount
[src/dwg.spec:875]: (style) Unused variable: rcount2
[src/dwg.spec:875]: (style) Unused variable: rcount3
[src/dwg.spec:875]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:891]: (style) Unused variable: vcount
[src/dwg.spec:891]: (style) Unused variable: rcount
[src/dwg.spec:891]: (style) Unused variable: rcount2
[src/dwg.spec:891]: (style) Unused variable: rcount3
[src/dwg.spec:891]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:907]: (style) Unused variable: vcount
[src/dwg.spec:907]: (style) Unused variable: rcount
[src/dwg.spec:907]: (style) Unused variable: rcount2
[src/dwg.spec:907]: (style) Unused variable: rcount3
[src/dwg.spec:907]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:924]: (style) Unused variable: vcount
[src/dwg.spec:924]: (style) Unused variable: rcount
[src/dwg.spec:924]: (style) Unused variable: rcount2
[src/dwg.spec:924]: (style) Unused variable: rcount3
[src/dwg.spec:924]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:939]: (style) Unused variable: vcount
[src/dwg.spec:939]: (style) Unused variable: rcount
[src/dwg.spec:939]: (style) Unused variable: rcount2
[src/dwg.spec:939]: (style) Unused variable: rcount3
[src/dwg.spec:939]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:954]: (style) Unused variable: vcount
[src/dwg.spec:954]: (style) Unused variable: rcount
[src/dwg.spec:954]: (style) Unused variable: rcount2
[src/dwg.spec:954]: (style) Unused variable: rcount3
[src/dwg.spec:954]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:968]: (style) Unused variable: vcount
[src/dwg.spec:968]: (style) Unused variable: rcount
[src/dwg.spec:968]: (style) Unused variable: rcount2
[src/dwg.spec:968]: (style) Unused variable: rcount3
[src/dwg.spec:968]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1027]: (style) Unused variable: rcount
[src/dwg.spec:1027]: (style) Unused variable: rcount2
[src/dwg.spec:1027]: (style) Unused variable: rcount3
[src/dwg.spec:1027]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1055]: (style) Unused variable: rcount
[src/dwg.spec:1055]: (style) Unused variable: rcount2
[src/dwg.spec:1055]: (style) Unused variable: rcount3
[src/dwg.spec:1055]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1087]: (style) Unused variable: vcount
[src/dwg.spec:1087]: (style) Unused variable: rcount
[src/dwg.spec:1087]: (style) Unused variable: rcount2
[src/dwg.spec:1087]: (style) Unused variable: rcount3
[src/dwg.spec:1087]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1102]: (style) Unused variable: vcount
[src/dwg.spec:1102]: (style) Unused variable: rcount
[src/dwg.spec:1102]: (style) Unused variable: rcount2
[src/dwg.spec:1102]: (style) Unused variable: rcount3
[src/dwg.spec:1102]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1117]: (style) Unused variable: vcount
[src/dwg.spec:1117]: (style) Unused variable: rcount
[src/dwg.spec:1117]: (style) Unused variable: rcount2
[src/dwg.spec:1117]: (style) Unused variable: rcount3
[src/dwg.spec:1117]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1134]: (style) Unused variable: vcount
[src/dwg.spec:1134]: (style) Unused variable: rcount
[src/dwg.spec:1134]: (style) Unused variable: rcount2
[src/dwg.spec:1134]: (style) Unused variable: rcount3
[src/dwg.spec:1134]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1196]: (style) Unused variable: vcount
[src/dwg.spec:1196]: (style) Unused variable: rcount
[src/dwg.spec:1196]: (style) Unused variable: rcount2
[src/dwg.spec:1196]: (style) Unused variable: rcount3
[src/dwg.spec:1196]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1210]: (style) Unused variable: vcount
[src/dwg.spec:1210]: (style) Unused variable: rcount2
[src/dwg.spec:1210]: (style) Unused variable: rcount3
[src/dwg.spec:1210]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1449]: (style) Unused variable: vcount
[src/dwg.spec:1449]: (style) Unused variable: rcount
[src/dwg.spec:1449]: (style) Unused variable: rcount2
[src/dwg.spec:1449]: (style) Unused variable: rcount3
[src/dwg.spec:1449]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1463]: (style) Unused variable: vcount
[src/dwg.spec:1463]: (style) Unused variable: rcount
[src/dwg.spec:1463]: (style) Unused variable: rcount2
[src/dwg.spec:1463]: (style) Unused variable: rcount3
[src/dwg.spec:1463]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1477]: (style) Unused variable: vcount
[src/dwg.spec:1477]: (style) Unused variable: rcount
[src/dwg.spec:1477]: (style) Unused variable: rcount2
[src/dwg.spec:1477]: (style) Unused variable: rcount3
[src/dwg.spec:1477]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1491]: (style) Unused variable: vcount
[src/dwg.spec:1491]: (style) Unused variable: rcount
[src/dwg.spec:1491]: (style) Unused variable: rcount2
[src/dwg.spec:1491]: (style) Unused variable: rcount3
[src/dwg.spec:1491]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1501]: (style) Unused variable: vcount
[src/dwg.spec:1501]: (style) Unused variable: rcount
[src/dwg.spec:1501]: (style) Unused variable: rcount2
[src/dwg.spec:1501]: (style) Unused variable: rcount3
[src/dwg.spec:1501]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1511]: (style) Unused variable: rcount
[src/dwg.spec:1511]: (style) Unused variable: rcount2
[src/dwg.spec:1511]: (style) Unused variable: rcount3
[src/dwg.spec:1511]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1544]: (style) Unused variable: rcount
[src/dwg.spec:1544]: (style) Unused variable: rcount2
[src/dwg.spec:1544]: (style) Unused variable: rcount3
[src/dwg.spec:1544]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1576]: (style) Unused variable: vcount
[src/dwg.spec:1576]: (style) Unused variable: rcount
[src/dwg.spec:1576]: (style) Unused variable: rcount2
[src/dwg.spec:1576]: (style) Unused variable: rcount3
[src/dwg.spec:1576]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1615]: (style) Unused variable: rcount
[src/dwg.spec:1615]: (style) Unused variable: rcount2
[src/dwg.spec:1615]: (style) Unused variable: rcount3
[src/dwg.spec:1615]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1676]: (style) Unused variable: vcount
[src/dwg.spec:1676]: (style) Unused variable: rcount
[src/dwg.spec:1676]: (style) Unused variable: rcount2
[src/dwg.spec:1676]: (style) Unused variable: rcount3
[src/dwg.spec:1676]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1696]: (style) Unused variable: vcount
[src/dwg.spec:1696]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1738]: (style) Unused variable: rcount
[src/dwg.spec:1738]: (style) Unused variable: rcount2
[src/dwg.spec:1738]: (style) Unused variable: rcount3
[src/dwg.spec:1738]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1753]: (style) Unused variable: rcount
[src/dwg.spec:1753]: (style) Unused variable: rcount2
[src/dwg.spec:1753]: (style) Unused variable: rcount3
[src/dwg.spec:1753]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1840]: (style) Unused variable: rcount
[src/dwg.spec:1840]: (style) Unused variable: rcount2
[src/dwg.spec:1840]: (style) Unused variable: rcount3
[src/dwg.spec:1840]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1852]: (style) Unused variable: rcount
[src/dwg.spec:1852]: (style) Unused variable: rcount2
[src/dwg.spec:1852]: (style) Unused variable: rcount3
[src/dwg.spec:1852]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1899]: (style) Unused variable: rcount
[src/dwg.spec:1899]: (style) Unused variable: rcount2
[src/dwg.spec:1899]: (style) Unused variable: rcount3
[src/dwg.spec:1899]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1911]: (style) Unused variable: rcount
[src/dwg.spec:1911]: (style) Unused variable: rcount2
[src/dwg.spec:1911]: (style) Unused variable: rcount3
[src/dwg.spec:1911]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1944]: (style) Unused variable: rcount
[src/dwg.spec:1944]: (style) Unused variable: rcount2
[src/dwg.spec:1944]: (style) Unused variable: rcount3
[src/dwg.spec:1944]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:1958]: (style) Unused variable: rcount2
[src/dwg.spec:1958]: (style) Unused variable: rcount3
[src/dwg.spec:1958]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2015]: (style) Unused variable: rcount
[src/dwg.spec:2015]: (style) Unused variable: rcount2
[src/dwg.spec:2015]: (style) Unused variable: rcount3
[src/dwg.spec:2015]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2027]: (style) Unused variable: rcount
[src/dwg.spec:2027]: (style) Unused variable: rcount2
[src/dwg.spec:2027]: (style) Unused variable: rcount3
[src/dwg.spec:2027]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2108]: (style) Unused variable: rcount
[src/dwg.spec:2108]: (style) Unused variable: rcount2
[src/dwg.spec:2108]: (style) Unused variable: rcount3
[src/dwg.spec:2108]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2120]: (style) Unused variable: rcount
[src/dwg.spec:2120]: (style) Unused variable: rcount2
[src/dwg.spec:2120]: (style) Unused variable: rcount3
[src/dwg.spec:2120]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2157]: (style) Unused variable: rcount
[src/dwg.spec:2157]: (style) Unused variable: rcount2
[src/dwg.spec:2157]: (style) Unused variable: rcount3
[src/dwg.spec:2157]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2169]: (style) Unused variable: rcount
[src/dwg.spec:2169]: (style) Unused variable: rcount2
[src/dwg.spec:2169]: (style) Unused variable: rcount3
[src/dwg.spec:2169]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2261]: (style) Unused variable: rcount
[src/dwg.spec:2261]: (style) Unused variable: rcount2
[src/dwg.spec:2261]: (style) Unused variable: rcount3
[src/dwg.spec:2261]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2273]: (style) Unused variable: rcount
[src/dwg.spec:2273]: (style) Unused variable: rcount2
[src/dwg.spec:2273]: (style) Unused variable: rcount3
[src/dwg.spec:2273]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2295]: (style) Unused variable: rcount
[src/dwg.spec:2295]: (style) Unused variable: rcount2
[src/dwg.spec:2295]: (style) Unused variable: rcount3
[src/dwg.spec:2295]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2320]: (style) Unused variable: rcount
[src/dwg.spec:2320]: (style) Unused variable: rcount2
[src/dwg.spec:2320]: (style) Unused variable: rcount3
[src/dwg.spec:2320]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2510]: (style) Unused variable: rcount
[src/dwg.spec:2510]: (style) Unused variable: rcount2
[src/dwg.spec:2510]: (style) Unused variable: rcount3
[src/dwg.spec:2510]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2522]: (style) Unused variable: vcount
[src/dwg.spec:2522]: (style) Unused variable: rcount
[src/dwg.spec:2522]: (style) Unused variable: rcount2
[src/dwg.spec:2522]: (style) Unused variable: rcount3
[src/dwg.spec:2522]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2543]: (style) Unused variable: rcount
[src/dwg.spec:2543]: (style) Unused variable: rcount2
[src/dwg.spec:2543]: (style) Unused variable: rcount3
[src/dwg.spec:2543]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2559]: (style) Unused variable: rcount2
[src/dwg.spec:2559]: (style) Unused variable: rcount3
[src/dwg.spec:2559]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2586]: (style) Unused variable: rcount
[src/dwg.spec:2586]: (style) Unused variable: rcount2
[src/dwg.spec:2586]: (style) Unused variable: rcount3
[src/dwg.spec:2586]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2599]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2713]: (style) Unused variable: rcount
[src/dwg.spec:2713]: (style) Unused variable: rcount2
[src/dwg.spec:2713]: (style) Unused variable: rcount3
[src/dwg.spec:2713]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2727]: (style) Unused variable: vcount
[src/dwg.spec:2727]: (style) Unused variable: rcount2
[src/dwg.spec:2727]: (style) Unused variable: rcount3
[src/dwg.spec:2727]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2765]: (style) Unused variable: rcount
[src/dwg.spec:2765]: (style) Unused variable: rcount2
[src/dwg.spec:2765]: (style) Unused variable: rcount3
[src/dwg.spec:2765]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2782]: (style) Unused variable: rcount
[src/dwg.spec:2782]: (style) Unused variable: rcount2
[src/dwg.spec:2782]: (style) Unused variable: rcount3
[src/dwg.spec:2782]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2794]: (style) Unused variable: rcount2
[src/dwg.spec:2794]: (style) Unused variable: rcount3
[src/dwg.spec:2794]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2814]: (style) Unused variable: rcount
[src/dwg.spec:2814]: (style) Unused variable: rcount2
[src/dwg.spec:2814]: (style) Unused variable: rcount3
[src/dwg.spec:2814]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2899]: (style) Unused variable: rcount2
[src/dwg.spec:2899]: (style) Unused variable: rcount3
[src/dwg.spec:2899]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2957]: (style) Unused variable: rcount
[src/dwg.spec:2957]: (style) Unused variable: rcount2
[src/dwg.spec:2957]: (style) Unused variable: rcount3
[src/dwg.spec:2957]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2979]: (style) Unused variable: vcount
[src/dwg.spec:2979]: (style) Unused variable: rcount
[src/dwg.spec:2979]: (style) Unused variable: rcount2
[src/dwg.spec:2979]: (style) Unused variable: rcount3
[src/dwg.spec:2979]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:2995]: (style) Unused variable: rcount
[src/dwg.spec:2995]: (style) Unused variable: rcount2
[src/dwg.spec:2995]: (style) Unused variable: rcount3
[src/dwg.spec:2995]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3010]: (style) Unused variable: rcount
[src/dwg.spec:3010]: (style) Unused variable: rcount2
[src/dwg.spec:3010]: (style) Unused variable: rcount3
[src/dwg.spec:3010]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3029]: (style) Unused variable: rcount
[src/dwg.spec:3029]: (style) Unused variable: rcount2
[src/dwg.spec:3029]: (style) Unused variable: rcount3
[src/dwg.spec:3029]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3061]: (style) Unused variable: vcount
[src/dwg.spec:3061]: (style) Unused variable: rcount
[src/dwg.spec:3061]: (style) Unused variable: rcount2
[src/dwg.spec:3061]: (style) Unused variable: rcount3
[src/dwg.spec:3061]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3076]: (style) Unused variable: rcount2
[src/dwg.spec:3076]: (style) Unused variable: rcount3
[src/dwg.spec:3076]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3769]: (style) Unused variable: rcount
[src/dwg.spec:3769]: (style) Unused variable: rcount2
[src/dwg.spec:3769]: (style) Unused variable: rcount3
[src/dwg.spec:3769]: (style) Variable 'dwg' is assigned a value that is never used.
[src/dwg.spec:3792]: (style) Unused variable: rcount
[src/dwg.spec:3792]: (style) Unused variable: rcount2
[src/dwg.spec:3792]: (style) Unused variable: rcount3
[src/dwg.spec:3792]: (style) Variable 'dwg' is assigned a value that is never used.
[src/encode.c:1067]: (style) Variable '_obj' is assigned a value that is never used.
[src/encode.c:1063]: (style) Variable 'dwg' is assigned a value that is never used.
[src/encode.c:1064]: (style) Unused variable: i
[src/encode.c:1065]: (style) Unused variable: vcount
[src/encode.c:1131]: (style) Variable 'obj' is assigned a value that is never used.
[src/header_variables.spec:214]: (style) Variable 'c1' is assigned a value that is never used.
[src/header_variables.spec:212]: (style) Variable 'c2' is assigned a value that is never used.
[src/header_variables.spec:213]: (style) Variable 'c3' is assigned a value that is never used.
[src/dwg.spec:1303]: (style) The scope of the variable 'vcount' can be reduced.
[src/dwg.spec:1303]: (style) The scope of the variable 'rcount' can be reduced.
[src/dwg.spec:1303]: (style) The scope of the variable 'rcount2' can be reduced.
[src/dwg.spec:1303]: (style) The scope of the variable 'index' can be reduced.
[src/dwg.spec:1304]: (style) The scope of the variable 'i' can be reduced.
[src/dwg.spec:1304]: (style) The scope of the variable 'j' can be reduced.
[src/dwg.spec:1304]: (style) The scope of the variable 'total_size' can be reduced.
[src/dwg.spec:1304]: (style) The scope of the variable 'num_blocks' can be reduced.
[src/dwg.spec:1302]: (style) Variable 'dwg' is assigned a value that is never used.
[src/handle.c:34]: (style) Unused variable: antckr
[src/handle.c:35]: (style) Unused variable: size
[src/handle.c:70]: (style) Variable 'last_handle' is assigned a value that is never used.
[src/handle.c:89]: (style) Variable 'kobj' is assigned a value that is never used.
[src/handle.c:211]: (style) Variable 'last_handle' is assigned a value that is never used.
[src/handle.c:297]: (style) Variable 'last_handle' is assigned a value that is never used.
[src/header.c:45]: (style) Variable 'c1' is assigned a value that is never used.
[src/header.c:46]: (style) Variable 'c2' is assigned a value that is never used.
[src/header.c:47]: (style) Variable 'c3' is assigned a value that is never used.
[src/dwg.spec:1449]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.spec:1463]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.spec:1477]: (style) Variable '_obj' is assigned a value that is never used.
[src/dwg.c:301]: (style) The function 'dwg_get_object_count' is never used.
[src/dwg.c:307]: (style) The function 'dwg_get_object_object_count' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)

21 September, 2013

  • Made documentation from doxygen.

20 September, 2013

  • Updated comments under examples directory.

19 September, 2013

  • Made changes to other directories according to GNU Coding standards.
  • Add the following comment style to each and every source file.

/**
* \file
* \brief
* \author written by
* \author modified by
* \author modified by
* \version
* \copyright GNU General Public License (version 3 or later)
*/

18 September, 2013

  • Updated comments under src directory and ran doxygen.

17 September, 2013

  • Made changes to decode_r2004.c, decode_r2004.h, decode_r2007.c, decode_r2007.h, encode.c, encode.h, Makefile.am, section_locate.c, section_locate.h, header.h, header.c, handle.c and handle.h files according to GNU Coding Standards.

15 – 16 September, 2013

  • Updated the src/Makefile.am and tested the library.

14 September, 2013

  • Refactor R2007:  Put the section map function in section_locate.c file.

13 September, 2013

  • Today, I refactored R2004 and R2007 versions according to common sections between them. Made new file compress_decompress.c and compress_decompress.h for compression and decompression functions and put the following functions:


int
read_R2004_literal_length(Bit_Chain *dat, unsigned char *opcode);

int
read_long_compression_offset(Bit_Chain *dat);

int
read_two_byte_offset(Bit_Chain *dat, int *lit_length);

int
decompress_R2004_section(Bit_Chain *dat, char *decomp,
uint32_t comp_data_size);

int
read_R2004_compressed_section(Bit_Chain *dat, Dwg_Data *dwg, Bit_Chain *sec_dat,
uint32_t section_type);

uint32_t
read_R2007_literal_length(unsigned char **src, unsigned char opcode);

void
read_instructions(unsigned char **src, unsigned char *opcode, uint32_t *offset,
uint32_t *length);

void
copy_bytes(char *dst, uint32_t length, uint32_t offset);

void
copy_compressed_bytes(char *dst, char *src, int length);

int
decompress_R2007(char *dst, int dst_size, char *src, int src_size);

12 September, 2013

  • Change bits.h, bits.c, classes.c, classes.h, common.c, common.h, common_entity_handle_data, decode.c, decode.h, dwg.c, dwg.h, dwg.spec, decode_r13_r15.h and decode_r13_r15.c files according to GNU coding standards.

11 September, 2013

  • Testing the Implemented changes.
  • Getting error in bindings/libredwg.py file that is generated automatically (Swig Interface).

8 – 10 September, 2013

  • Implemented the commit “wip-Decode R2007 variables and objects” from r2007 branch to refactoring branch.

7 September, 2013

  • Till already Implemented these sections under r2007 branch.
  • Checking It:

http://git.savannah.gnu.org/cgit/libredwg.git/commit/?h=r2007&id=2b7c6d52a8a94ee0139e885af742b84e68dd532e

6 September, 2013

  • Today, I sent mail to Till (a great programmer) about changes and waiting for the reply.

5 September, 2013

  • Today I have tested all the implemented changes, got SegFault :D
  • Found the reason behind is Classes and Header sections.

4 September, 2013

  • Today I have started with Header section.
  • I think for R2007+ the way to pass data is different.

3 September, 2013

  • There is one line under classes section: “note that strings are in the string stream for R2007+” that I am not getting what does it mean. Trying to understand It.

2 September, 2013

  • Implemented the Classes section but getting errors.

31 August, 2013

  • Stumbled with Classes section for R2007 version.

30 August, 2013

  • Implemented the 64-bit Mirror CRC.

29 August, 2013

  • Explored Object types under Objects sections(19.3) of DWG specs(version 5.3, pg no. 102) and fixed the object type’s values (dwg.h).

28 August, 2013

  • Explored header variables under header section(8.0) of DWG specs(version 5.3, pg no. 68) and made changes to dwg.h file (fill the unknown variables).

27 August, 2013

  • Implemented the data page checksum.

26 August, 2013

  • Today I focused upon dump patch (by Felipe Castro) and Implemented It (but getting errors).

24 August, 2013

  • Stumbled with SegFault while testing with file.

23 August, 2013

  • Implemented 64-bit Normal CRC.

22 August, 2013

  • Today I created header file for R2007 version.

21 August, 2013

  • Finally I have started with R2007 decode coding.

20 August, 2013

  • Today I made git commit with little modifications.

18 – 19 August, 2013

  • Focusing on 64 bit CRC.

17 August, 2013

  • Today I installed Draftsight, but not getting the right UI.
  • Finding the solution.

16 August, 2013

  • Today I changed the “tio” as “as” in various files under src/ and bindings/ directories.
  • Tested successfully.

14 – 15 August, 2013

  • Understand the 32-bit data page checksum calculation.

13 August, 2013

  • Stumbled with data page section calculation.

12 August, 2013

  • Focused on how to write data section page.

10 August, 2013

  • Concentrated on how to calculate the system section page size.

9 August, 2013
Today I did focused on system section page used by two section maps:
1. Data Section
2. Page Section

Inputs for system section page are:
1. Data
2. 64-bit CRC seed
3. Page size

8 August, 2013

  • Reed Solomon algorithm: Its encoding algorithm. Trying to understand it’s working and coding part.

7 August, 2013

  • Understanding the normal and mirrored CRC.

6 August, 2013

  • Reading R2007 specifications to find which is left to implement.

5 August, 2013

  • Stumbling with compressed function. Actually not clear with various “copy” functions.

3 August, 2013

  • Good to see Lead Developer back. Now LibreDWG will rock soon.
  • I think after adding read support, we must focus on it’s write support.
  • Actually my concepts of macros and header guards are not clear, so exploring these, implementing it by creating a small example.
  • Started with R2007 version.

2 August, 2013

  • Found the duplicacy in header.c and handle.c, but I have not removed it.
  • I think I can reduce more code that will not effect the code readability and maintainability.

1 August, 2013

  • Stumbled with warnings and logging.h.

31 July, 2013

  • Today I updated the data types by including stdint.h library.
  • Removed -Wformat warnings.
  • Now dealing with other warnings.

July is over with happy GSoC Mid Term Evaluation. :)

30 July, 2013

  • Finally with the guidance of Till, I am able to remove the error.
  • Made minor changes a/c to coding standards.
  • Updated documentation with comments.

So happy, refactoring is successfully tested.
It mades my day. :)
Thank you LibreDWG.

29 July, 2013

  • Today I posted my all work till now on mailing list so that If any improvements needed, I do.
  • Tested the work; stumbled with a compile time error:

In file included from object.c:27:0:
dwg.spec: In function ‘dwg_decode_INSERT':
dwg.spec:341:7: error: ‘DECODER’ undeclared (first use in this function)
dwg.spec:341:7: note: each undeclared identifier is reported only once
for each function it appears in
dwg.spec:342:9: error: expected ‘;’ before ‘{‘ token
dwg.spec: In function ‘dwg_decode_MINSERT':
dwg.spec:458:7: error: ‘DECODER’ undeclared (first use in this function)
dwg.spec:459:9: error: expected ‘;’ before ‘{‘ token

But “DECODER” is declared in dwg.spec file under IS_DECODER macro and this
macro is used in decode.h file.
Trying to solve it.

28 July, 2013

  • Checked the previous work as decoding R2004 version.
  • Added 32 bit CRC in bits.c file.
  • Successfully added the code for checking header, handle, section map and classes’s CRC to refactored code.

Then after this, I got a reason behind segfault.
When I resize the variables of encrypted struct under decode_r2004() function in decode_r2004.c file, then It throws segfault, otherwise not.

Then I added section page checksum to refactored code in decode_r2004.c file.
Again I am surprised how is it?
CRC will always different to section page checksum, then why it throws segfault.

Then specs may be wrong in it’s way.

27 July, 2013

  • Modified all files under src directory according to GNU coding standards.
  • And It consumed my whole day.
  • Today I came to know about Google Doc Camp.

https://sites.google.com/site/docsprintsummitv2/

I am very interested in contributing to documentation.

26 July, 2013

  • Adding comments to print.c, print.h, reolve_pointer.c, resolve_pointers.h, handle.c, handle.h, header.c, header.h, logging.h, header_variables.spec, dwg.c, dwg.h, encode.c, encode.h, decode_r13_r15.c, decode_r13_r15.h, decode_r2004.c, decode_r2004.h, decode_r2007.c file, section_locate.c and section_locate.h files.
  • And made documentation from doxygen.

25 July, 2013

  • Start working on documentation using doxygen. Edit the doxygen file.
  • Modified the README file for documentation.
  • Will add the following to all files:

/**
* \file dwg.h
* \brief Main include file
* \author written by Felipe Castro
* \author modified by Felipe Corrêa da Silva Sances
* \author modified by Rodrigo Rodrigues da Silva
* \author modified by Till Heuschmann
* \version
* \copyright GNU General Public License (version 3 or later)
*/

  • Gave proper comments to decode.c, decode.h, bits.c, bits.h, common.h, common.c, classes.c and classes.h file.
  • Modified decode_r2004.c file by including library.

24 July, 2013

  • Got reply from Till:

” This are the steps I needed to compile it successfully:

encode.c:718
change to #include “dwg.spec”
and move to line 252

resolve_pointers.c
add include “logging.h”

section_locate.c
add include “logging.h”

object.c
change includes to
#include “dwg.h”
#include “object.h”
#include “logging.h”
#include “decode.h”
#include “dwg.spec”

Add include guards to all header files like:
#ifndef _DWG_OBJECT_H_
#define _DWG_OBJECT_H_

#endif

decode.h
Add declarations
int dwg_decode_object( … )
int dwg_decode_entity( … )
Dwg_Object_Ref* dwg_decode_handleref( … )
Dwg_Object_Ref* dwg_decode_handleref_with_code( … )
int dwg_decode_common_entity_handle_data( … )

dwg.spec
Add the forward declaration:
void decode_3dsolid(Bit_Chain* dat, Dwg_Object* obj, Dwg_Entity_3DSOLID* _obj);
void encode_3dsolid(Bit_Chain* dat, Dwg_Object* obj, Dwg_Entity_3DSOLID* _obj);
remove the “inline” keyword from this function declarations

remove all “static” keywords from the .h and .c files. Static functions in C limit the use of the function to the module (.c file) in which the are defined. It is not possible to access a static function from another source file and that is why static function declarations make no sense in .h files.

decode_r2004.h
remove the declaration of the function read_literal_length() and make a forward declaration in decode_r2004.c to this function instead. In r2007…. a function with the same name exists (this function could be static because it is just used in this file)

The variable loglevel is defined in several files. Just define it once and declare it as external in the other files.

That’s all, now my compiler says: 0 Errors!”

  • Made the above changes but the same error is still there.

23 July, 2013

  • Finally got Till’s mail about how to solve error. According to him I moved all macros from decode.c to decode.h. But now getting errors about dwg.spec file.
  • Further tested for any errors but I think It’s a problem related to macros still.

22 July, 2013

  • Made branch at Savannah to push up the code.

http://git.savannah.gnu.org/cgit/libredwg.git

  • Refactored the further code.

21 July, 2013

  • Stumbled with the same error.
  • Tried a lot but didn’t get it where the problem is.

20 July, 2013

  • I am happy today. Finally got commit access. :)
  • And my both patches are accepted and reported bug is confirmed.
  • Reviewed Gagan’s work as their commit comments are not logical, no README file and no proper comments. Also not obeying GNU coding standards.
  • I am unable to do testing because he has not mentioned any instructions to execute.

19 July, 2013

  • Made object.c file for decoding objects.
  • Modified makefile.am file.
  • Finally rough refactoring is finish but getting error about spec file.

18 July, 2013

  • Today I made section_locate.c file for locating maps for both versions. Also created resolve_pointers.c file for resolving pointers.
  • Modified makefile.am file.

17 July, 2013

  • Today I put uncommon function in decode_r2004.c file and decode_r13_r15.c files with their respective header files.
  • Modified makefile.am file.

16 July, 2013

  • I have made header.c, handle.c and classes.c file with their respective header files. These sections are common for every DWG version. Currently I am refactoring only R13-R18, not R21 and modified makefile.am file.
  • Also reviewed Gagan’s new patch related to header variables. It is not right, need further changes.

15 July, 2013

  • Still going with R2000 refactoring and playing with beautiful errors.

13 July, 2013

  • Started refactoring with R2000 simply put the complete function in decode_r2000.c file, tested and breaking this.

12 July, 2013

  • I am going with second alternative i.e

Make .h file to decode every version like declaration of decode_R13_R15()
will be in decode_r2000.h file and definition in decode_r2000.c file and
calling from decode.c file by dwg_decode_data().

  • Deciding which functions should I put in decode.c file or made new one or some other best alternative.

11 July, 2013

  • Waiting for reply and exploring more so that I can start refactoring soon.

10 July, 2013

  • Proposed two solution from his Idea.

Handle section (Object map in case of R13-R15), Section (map in
R2004 and locator
records in R13 – R15) and Header variables are common part.
So I will make .h (handle.h, section_record.h and header.h) and .c
files for these.

In decode.c file, there are six private functions

/************************************************************************/

static void
dwg_decode_add_object(Dwg_Data * dwg, Bit_Chain * dat,
long unsigned int address);

static Dwg_Object *
dwg_resolve_handle(Dwg_Data* dwg, unsigned long int handle);

static void
dwg_decode_header_variables(Bit_Chain* dat, Dwg_Data * dwg);

static void
resolve_objectref_vector(Dwg_Data * dwg);

/********************************************************************/

Above these functions are used in every version.
So will put in new common_ref.h file or declare in decode.h file.
So guide me on this.


/*********************************************************************/

int decode_R13_R15(Bit_Chain* dat, Dwg_Data * dwg);

int read_r2007_meta_data(Bit_Chain *dat, Dwg_Data *dwg);

/********************************************************************/
According to my review, there are two paths either
– Declare decoding function of every version in decode.h file and define in
separate file depending upon its version.
OR
– Make .h file to decode every version like declaration of decode_R13_R15()
will be in decode_r2000.h file and definition in decode_r2000.c file and
calling from decode.c file by dwg_decode_data().

9 July, 2013

  • Got reply from Till Sir.
  • I am exploring his idea and will report soon there.

8 July, 2013

  • Today I tested one of the reported bug about conversion error that is invalid. I am getting no error while compiling standalone *.c files.
  • Proposed refactoring Idea on mailing list as follows:

Implementation of R2000 version is complete. So I think I should start
refactoring of decode.c file for R2000 version.
The main function “dwg_decode_data ()” which decodes the DWG file
depending upon it’s version, call other functions like
for R2000, call “decode_R13_R15 ()”,
for R2004, call “decode_R2004 ()”,
for R2007, call “decode_R2007 ()”

In main function definition, a little bit refactoring is also required.
To compare the DWG version, each and every time if statements are run
to get the single result.
So it’s better to use if-else like

/**************************************************************************************************/

dwg->header.version = 0;
if (!strcmp (version, version_codes[R_13]))
dwg->header.version = R_13;
else if (!strcmp (version, version_codes[R_14]))
dwg->header.version = R_14;
else if (!strcmp (version, version_codes[R_2000]))
dwg->header.version = R_2000;
else if (!strcmp (version, version_codes[R_2004]))
dwg->header.version = R_2004;
else if (!strcmp (version, version_codes[R_2007]))
dwg->header.version = R_2007;
else
printf (” Invalid or unimplemented version “);

/***************************************************************************************************/

Now Introducing a new thing, for every decoding version, there will a
separate decoding file.
We must define “decode_R13_R15 ()” in decode_r2000.c file.

To decode a R2000 version, there is a single function “decode_R13_R15
()” that is doing every thing consisting of 491 lines.
Hence, we should break this function into sub-smaller functions based
on sections like for

  1. Unknown section 1
  2. Picture (Pre-R13C3)
  3. Header variables
  4. Classes
  5. Object map
  6. Second header
  7. Section measurement

Waiting for response there.

7 July, 2013

  • Today I tested my warning patch on 32-bit system. It is compiling and running without any error. So both of my patches are correct.
  • Again tested modified unsupported version patch. Again it’s further require modifications.
  • How to made patch for git repo?

Go to directory.
$ cd libredwg/

Run
$ git diff > version.patch

  • Clearing all doubts so that I can propose my refactoring Idea.

6 July, 2013

  • We can refactor the code in various ways. But we have to maintain it’s current functionaity. So I will propose my Idea on mailing list.
  • Stumbled with code to get out the efficient Idea for refactoring.

5 July, 2013

  • Today I tested my submitted patches again so that I can get push access to repository and verified my reported bug.
  • One of my patch related to warnings need to test on 32-bit system. So I will do it tomorrow.
  • Also tested Gagan’s patch. But his conversion patch was not made through git. So I was not able to apply my repo directly.

4 July, 2003

  • Today, I got reply from Till Sir about resizing of fields. Already thought in mind that when I will refactor decode.c file then I use stdlib.h header file for saving the bytes like he suggested as follows:

int64_t type for 8 Byte types and
int32_t for 4 Byte types

Same thing is already implemented in decode_2007.c file.

  • Reviewing the pointer tutorials so that I can clear all doubts with this concept.
  • Reviewed one of the patch submitted by Gagan. It’s about segmentation fault on unsupported version.

He is using if (condition) to check for version.
I proposed him to use either switch or if-else.

3 July, 2013

  • Showed code to mentors after modification with page checksum.
  • Explored following links for refactoring R2004 code:

https://en.wikipedia.org/wiki/Category:Programming_principles
https://en.wikipedia.org/wiki/Category:Programming_rules_of_thumb

2 July, 2013

  • Understanding the refactoring concept and it’s techniques.

https://en.wikipedia.org/wiki/Code_refactoring

https://en.wikipedia.org/wiki/Polymorphism_(computer_science)

https://en.wikipedia.org/wiki/Code_smell

28 – 30 June, 2013

I was ill.

27 June, 2013

  • Understanding the system section page and trying to sort out the section page checksum.

26 June, 2013

  • Trying to sort out the segmentation fault by recorrecting the order, but segfault is still there.

25 June, 2013

  • By reading DWG specs again clearing my doubts and queries.
  • Find out the detailed history of DWG and reviewing different versions of specs.

24 June, 2013

  • Trying to understand the DWG structure by comparing with DXF.
  • Finding out the entities in different versions by understanding the DWG specs.

23 June, 2013

  • After implementing CRC and section page header of R2004, still it is throwing segmentataion vault.
  • Also got comment on patch that I showed to Mentors.
  • Reviewing the ODA specifications and finding the right order of DWG structure.

22 June, 2013

  • Today I stumbled with min function that used in section page checksum calculation.
  • We can use min() by including header file “stdlib.h”. min() returns minimum of two numbers of same type. But the main problem is that this is used only in C++. When we use in C, it gives “undefined reference” error. Then I use if-else for finding minimum.
  • Implemented the header, section map and info with redefined specs.
  • Made final patch for checking.

21 June, 2013

  • Implemented the section page checksum. But this too needs testing.
  • I am waiting for mentors response because I have a queries in mind to clear.

20 June, 2013

  • CRC task is completed. Only need to test it. CRC will check header, handles and classes section.
  • Understanding the data section specs.

19 June, 2013

  • Today I struggled a lot to understand the LibreDWG code and concluded that it is easy to start from a scratch but when we have to understand the someone else’s code to enhance it then we call “Programmers”.
  • Defined the CRC32 for  AcDbHeader  section like as follows:
unsigned long int ckr, ckr2;
dat->byte = dwg->header.section[0].address + dwg->header.section[0].size - 18;
dat->bit = 0;
<span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; white-space: pre;">
</span>ckr = bit_read_RL(&dat);
ckr2 = bit_ckr32(0xc0c1, &sec_dat.chain + dwg->header.section[0].address + 16,
dwg->header.section[0].size - 34);
<span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; white-space: pre;">
</span>if (ckr != ckr2)
{
printf("section %d crc todo ckr:%ul ckr2:%ul\n",
dwg->header.section[0].number, ckr, ckr2);
return -1;
}
<span style="font-size: 11.818181991577148px; line-height: 17.99715805053711px; white-space: pre;">
</span>
  • Understand the RS, RL and others by reading bits.c file.

18 June, 2013

if version >= R2004, then call crc32 else call crc8.

17 June, 2013

  • Trying to understand the file structure of R2004 by comparing with previous versions and LibreDWG structure.
  • Revise pointers and C Data types.
  • Searched a lot for specs version 5.0, but didn’t found it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About

I am Avneet Kaur, student of Bachelor of Engineering under CSE stream  at Guru Nanak Dev Engineering College, Ludhiana.

I love coding in vim editor. My interests are programming, CAD and reverse engineering.

My hobbies are cycling and listening music.

Always excited to learn new things.

2 thoughts on “About

  1. Hey your article on linking google unit testing library with g++ was really helpful.
    I was playing around quite some time trying to get it to link.
    If this was on the gtest wiki it’d have saved me a lot of time.

    So thank you very much!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s