formatting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
diff --git a/ChangeLog b/ChangeLog
index b1b7b4c..4b08fc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,16 @@
-2001-05-08 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
+2001-05-08 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
- * src/pcfdriver.c: fixed incorrect bitmap width computation
+ * src/pcfdriver.c: Fixed incorrect bitmap width computation.
2001-05-08 David Turner <david@freetype.org>
- * docs/docmaker.py: updated the DocMaker script in order to add
- command line options (--output,--prefix,--title), fix the erroneous
- line numbers reported during errors and warnings, and other formatting
- issues..
+ * docs/docmaker.py: Updated the DocMaker script in order to add
+ command line options (--output,--prefix,--title), fix the erroneous
+ line numbers reported during errors and warnings, and other
+ formatting issues.
- * src/base/ftcalc.c: various tiny fixes related to rounding in 64-bits
- routines and pseudo"optimisations" :-)
+ * src/base/ftcalc.c: Carious tiny fixes related to rounding in
+ 64-bits routines and pseudo"optimizations" :-)
2001-04-27 David Turner <david@freetype.org>
diff --git a/docs/docmaker.py b/docs/docmaker.py
index 08ff445..17288f3 100644
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -9,16 +9,16 @@
# DocMaker is very similar to other tools like Doxygen, with the
# following differences:
#
-# - it is written in Python (so it's slow, but easy to maintain and
-# improve)
+# - It is written in Python (so it is slow, but easy to maintain and
+# improve).
#
-# - the comment syntax used by DocMaker is simpler and makes for
-# clearer comments
+# - The comment syntax used by DocMaker is simpler and makes for
+# clearer comments.
#
# Of course, it doesn't have all the goodies of most similar tools,
-# (e.g. C++ class hierarchies), but hey, it's only 2000 lines of
-# python
-#
+# (e.g. C++ class hierarchies), but hey, it is only 2000 lines of
+# Python.
+#
# DocMaker is mainly used to generate the API references of several
# FreeType packages.
#
@@ -28,18 +28,19 @@
import fileinput, sys, os, string, glob, getopt
# The Project's title. This can be overridden from the command line with
-# the options "-t" or "--title"
-project_title = "Project"
+# the options "-t" or "--title".
+#
+project_title = "Project"
-# The project's filename prefix. This can be set from the command line with
+# The project's filename prefix. This can be set from the command line with
# the options "-p" or "--prefix"
#
project_prefix = ""
-# The project's documentation output directory. This can be set from the
-# command line with the options "-o" or "--output"
+# The project's documentation output directory. This can be set from the
+# command line with the options "-o" or "--output".
#
-output_dir = None
+output_dir = None
# The following defines the HTML header used by all generated pages.
@@ -177,13 +178,13 @@ def html_format( line ):
return result
-# open the standard output to a given project documentation file
-# use "output_dir" to determine the filename location, when necessary
-# and save the old stdout in a tuple that is returned by this function
+# Open the standard output to a given project documentation file. Use
+# "output_dir" to determine the filename location if necessary and save the
+# old stdout in a tuple that is returned by this function.
#
def open_output( filename ):
global output_dir
-
+
if output_dir and output_dir != "":
filename = output_dir + os.sep + filename
@@ -194,22 +195,23 @@ def open_output( filename ):
return ( new_file, old_stdout )
-# close the output that was returned by "close_output"
-#
+# Close the output that was returned by "close_output".
#
def close_output( output ):
output[0].close()
sys.stdout = output[1]
-# check output directoy
+
+# Check output directory.
#
def check_output( ):
global output_dir
if output_dir:
if output_dir != "":
if not os.path.isdir( output_dir ):
- sys.stderr.write( "argument '"+output_dir+"' is not a valid directory" )
- sys.exit(2)
+ sys.stderr.write( "argument" + " '" + output_dir + "' " +
+ "is not a valid directory" )
+ sys.exit( 2 )
else:
output_dir = None
@@ -416,7 +418,7 @@ class DocParagraph:
i = 0
while i < l and word[i] in alphanum:
i = i + 1
-
+
if i < l:
extra = word[i :]
word = word[0 : i]
@@ -939,11 +941,11 @@ class DocSection:
#
if self.elements.has_key( block.name ):
block.print_error( "duplicate element definition for " +
- "'" + block.name + "' " +
- "in section " +
- "'" + self.name + "'\n" +
- "previous definition in " +
- "'" + self.elements[block.name].location() + "'" )
+ "'" + block.name + "' " +
+ "in section " +
+ "'" + self.name + "'\n" +
+ "previous definition in " +
+ "'" + self.elements[block.name].location() + "'" )
self.elements[block.name] = block
self.list.append( block )
@@ -1119,20 +1121,17 @@ class DocSectionList:
def dump_html_sections( self ):
-
for section in self.sections.values():
if section.filename:
output = open_output( section.filename )
-
+
section.dump_html( self.identifiers )
-
- close_output( output )
+ close_output( output )
def dump_html_index( self ):
-
- output = open_output( self.index_filename )
+ output = open_output( self.index_filename )
num_columns = 3
total = len( self.index )
@@ -1387,8 +1386,8 @@ def make_block_list( args = None ):
# sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )
if not args:
- args = sys.argv[1:]
-
+ args = sys.argv[1 :]
+
for pathname in args:
if string.find( pathname, '*' ) >= 0:
newpath = glob.glob( pathname )
@@ -1595,25 +1594,28 @@ def main( argv ):
global html_header, html_header1, html_header2, html_header3
try:
- opts, args = getopt.getopt( sys.argv[1:], "ht:o:p:", [ "help", "title=", "output=", "prefix=" ] )
-
+ opts, args = getopt.getopt( sys.argv[1:],
+ "ht:o:p:",
+ [ "help", "title=", "output=", "prefix=" ] )
+
except getopt.GetoptError:
usage()
- sys.exit(2)
+ sys.exit( 2 )
if args == []:
usage()
- sys.exit(1)
+ sys.exit( 1 )
# process options
+ #
project_title = "Project"
- project_prefix = None
+ project_prefix = None
output_dir = None
-
+
for opt in opts:
if opt[0] in ( "-h", "--help" ):
usage()
- sys.exit(0)
+ sys.exit( 0 )
if opt[0] in ( "-t", "--title" ):
project_title = opt[1]
@@ -1628,9 +1630,11 @@ def main( argv ):
check_output( )
# we begin by simply building a list of DocBlock elements
+ #
list = make_block_list( args )
# now, sort the blocks into sections
+ #
document = DocDocument()
for block in list:
document.append_block( block )
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index eb02719..dfcecc1 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -138,6 +138,7 @@
FT_Int s;
FT_Long d;
+
s = 1;
if ( a < 0 ) { a = -a; s = -1; }
if ( b < 0 ) { b = -b; s = -s; }
@@ -146,7 +147,7 @@
d = ( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
: 0x7FFFFFFFL );
- return ( s > 0 ) ? d : -d;
+ return ( s > 0 ) ? d : -d;
}
@@ -156,13 +157,14 @@
FT_Long b )
{
FT_Int s = 1;
- FT_Long c;
+ FT_Long c;
+
if ( a < 0 ) { a = -a; s = -1; }
if ( b < 0 ) { b = -b; s = -s; }
c = (FT_Long)( ( (FT_Int64)a * b + 0x8000 ) >> 16 );
- return ( s > 0 ) ? c : -c ;
+ return ( s > 0 ) ? c : -c ;
}