Commit 3780273e3e000a728adc97d0a35642347037ca1b

Werner Lemberg 2001-04-26T13:34:36

* builds/unix/config.guess, builds/unix/config.sub: Updated to latest versions from gnu.org. * builds/compiler/gcc-dev.mk: Add `-Wno-long-long' flag. * include/freetype/internal/ftcalc.h: Define FT_SqrtFixed() uncoditionally. * src/base/ftbbox.c: Include FT_INTERNAL_CALC_H. Fix compiler warnings. * src/base/ftcalc.c: Fix (potential) compiler warnings. * src/base/ftcalc.c (FT_SqrtFixed): Corrected/optimized the 32-bit fixed-point square root computation. It is now used even with 64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-) * src/base/ftbbox.c: Removed invalid "#include FT_BEZIER_H" line. * src/base/ftbbox.c (BBox_Cubic_Check): Rewrote function to use direct computations with 16.16 values instead of sub-divisions. It is now slower, but proves a point :-) * src/raster/ftraster.c, src/smooth/ftgrays.c, src/base/ftbbox.c: Fixed the bezier stack depths. * src/base/ftcalc.c (FT_MulFix): Minor rounding fix. * builds/beos: Added BeOS-specific files to the old build system (no changes were necessary to support BeOS in the Jamfile though). * ftconfig.h, ftoption.h: Updated "ftconfig.h" to detect 64-bit int types on platforms where Autoconf is not available). Also removed FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64. * builds/win32/freetype.dsp: Updated the Visual C++ project file. Doesn't create a DLL yet. * cffgload.c: Removed a compilation warning.

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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
diff --git a/ChangeLog b/ChangeLog
index 0722b6a..559702d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,35 +1,49 @@
+2001-04-26  Werner Lemberg  <wl@gnu.org>
+
+	* builds/unix/config.guess, builds/unix/config.sub: Updated to
+	latest versions from gnu.org.
+
+	* builds/compiler/gcc-dev.mk: Add `-Wno-long-long' flag.
+
+	* include/freetype/internal/ftcalc.h: Define FT_SqrtFixed()
+	uncoditionally.
+	* src/base/ftbbox.c: Include FT_INTERNAL_CALC_H.
+	Fix compiler warnings.
+	* src/base/ftcalc.c: Fix (potential) compiler warnings.
+
 2001-04-26  David Turner  <david@freetype.org>
 
-	* src/base/ftcalc.c (FT_SqrtFixed): corrected/optimised the 32-bit
-	fixed-point square root. it is now used even with 64-bits
-	ints, as it's simply _much_ faster than calling FT_Sqrt64 :-)
+	* src/base/ftcalc.c (FT_SqrtFixed): Corrected/optimized the 32-bit
+	fixed-point square root computation.  It is now used even with
+	64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-)
 
-    * src/base/ftbbox.c : removed invalid "#include FT_BEZIER_H" line
+	* src/base/ftbbox.c: Removed invalid "#include FT_BEZIER_H" line.
 
 2001-04-25  David Turner  <david@freetype.org>
 
-        * src/base/ftbbox.c (BBox_Cubic_Check): rewrote function to use
-        direct computations with 16.16 values instead of sub-divisions.
-        It is now slower, but proves a point :-)
+	* src/base/ftbbox.c (BBox_Cubic_Check): Rewrote function to use
+	direct computations with 16.16 values instead of sub-divisions.  It
+	is now slower, but proves a point :-)
 
-        * src/raster/ftraster.c, src/smooth/ftgrays.c, src/base/ftbbox.c :
-        fixed the bezier stack depths..
+	* src/raster/ftraster.c, src/smooth/ftgrays.c, src/base/ftbbox.c:
+	Fixed the bezier stack depths.
 
-        * src/base/ftcalc.c (FT_MulFix): minor rounding fix
+	* src/base/ftcalc.c (FT_MulFix): Minor rounding fix.
 
-        * builds/beos : added BeOS-specific files to the old build system
-        (no changes were necessary to support BeOS in the Jamfile though)
+	* builds/beos: Added BeOS-specific files to the old build system
+	(no changes were necessary to support BeOS in the Jamfile though).
 
 2001-04-20  David Turner  <david@freetype.org>
 
-	* ftconfig.h, ftoption.h: updated "ftconfig.h" to detect 64-bit int
-	types on platforms where Autoconf is not available). Also removed
-	FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64
+	* ftconfig.h, ftoption.h: Updated "ftconfig.h" to detect 64-bit int
+	types on platforms where Autoconf is not available).  Also removed
+	FTCALC_USE_LONG_LONG and replaced it with
+	FT_CONFIG_OPTION_FORCE_INT64.
 	
-	* builds/win32/freetype.dsp: updated the Visual C++ project file. Doesn't
-	create a DLL yet..
+	* builds/win32/freetype.dsp: Updated the Visual C++ project file.
+	Doesn't create a DLL yet.
 
-	* cffgload.c: removed a compilation warning
+	* cffgload.c: Removed a compilation warning.
 
 2001-04-10  Tom Kacvinsky  <tjk@ams.org>
 
diff --git a/docs/docmaker.py b/docs/docmaker.py
index 5c0c304..d09a642 100644
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -10,11 +10,11 @@
 
 import fileinput, sys, string, glob
 
-# the Project's title, this can be over-ridden from the command line with
-# an option
+# The Project's title.  This can be overridden from the command line with
+# an option.
 project_title = "Project"
 
-# The following defines the HTML header used by all generated pages
+# The following defines the HTML header used by all generated pages.
 #
 html_header_1 = """\
 <html>
@@ -38,52 +38,54 @@ html_header_2= """ API Reference</title>
 
 html_header_3=""" API Reference</h1></center>
 """
-# this is recomputed later when the project title changes
+
+# This is recomputed later when the project title changes.
+#
 html_header = html_header_1 + project_title + html_header_2 + project_title + html_header_3
 
-# The HTML footer used by all generated pages
+# The HTML footer used by all generated pages.
 #
 html_footer = """\
 </body>
 </html>"""
 
-# The header and footer used for each section
+# The header and footer used for each section.
 #
 section_title_header = "<center><h1>"
 section_title_footer = "</h1></center>"
 
-# The header and footer used for code segments
+# The header and footer used for code segments.
 #
 code_header = "<font color=blue><pre>"
 code_footer = "</pre></font>"
 
-# Paragraph header and footer
+# Paragraph header and footer.
 #
 para_header = "<p>"
 para_footer = "</p>"
 
-# Block header and footer
+# Block header and footer.
 #
 block_header = "<center><table width=75%><tr><td>"
 block_footer = "</td></tr></table><hr width=75%></center>"
 
-# Description header/footer
+# Description header/footer.
 #
 description_header = "<center><table width=87%><tr><td>"
 description_footer = "</td></tr></table></center><br>"
 
-# Marker header/inter/footer combination
+# Marker header/inter/footer combination.
 #
 marker_header = "<center><table width=87% cellpadding=5><tr bgcolor=#EEEEFF><td><em><b>"
 marker_inter  = "</b></em></td></tr><tr><td>"
 marker_footer = "</td></tr></table></center>"
 
-# Source code extracts header/footer
+# Source code extracts header/footer.
 #
 source_header = "<center><table width=87%><tr bgcolor=#D6E8FF width=100%><td><pre>"
 source_footer = "</pre></table></center><br>"
 
-# Chapter header/inter/footer
+# Chapter header/inter/footer.
 #
 chapter_header = "<center><table width=75%><tr><td><h2>"
 chapter_inter  = "</h2><ul>"
@@ -92,8 +94,8 @@ chapter_footer = "</ul></td></tr></table></center>"
 current_section = None
 
 
-# This function is used to sort the index.  It's a simple lexicographical
-# sort, except that it places capital letters before small ones.
+# This function is used to sort the index.  It is a simple lexicographical
+# sort, except that it places capital letters before lowercase ones.
 #
 def index_sort( s1, s2 ):
     if not s1:
@@ -126,7 +128,7 @@ def index_sort( s1, s2 ):
     return 0
 
 
-# sort input_list, placing the elements of order_list in front
+# Sort input_list, placing the elements of order_list in front.
 #
 def sort_order_list( input_list, order_list ):
     new_list = order_list[:]
@@ -136,8 +138,8 @@ def sort_order_list( input_list, order_list ):
     return new_list
 
 
-# translate a single line of source to HTML. This will convert
-# a "<" into "&lt.", ">" into "&gt.", etc..
+# Translate a single line of source to HTML.  This will convert
+# a "<" into "&lt.", ">" into "&gt.", etc.
 #
 def html_format( line )
     result = string.replace( line, "<", "&lt." )
@@ -146,8 +148,8 @@ def html_format( line )
     return result
 
 
-# The FreeType 2 reference is extracted from the source files. These contain
-# various comment blocks that follow one of the following formats:
+# The FreeType 2 reference is extracted from the source files.  These
+# contain various comment blocks that follow one of the following formats:
 #
 #  /**************************
 #   *
@@ -176,7 +178,7 @@ def html_format( line )
 #  /**************************/
 #
 # Each block contains a list of markers; each one can be followed by
-# some arbitrary text or a list of fields. Here's an example:
+# some arbitrary text or a list of fields.  Here an example:
 #
 #    <Struct>
 #       MyStruct
@@ -195,15 +197,15 @@ def html_format( line )
 #
 # Each field is simply of the format:  WORD :: TEXT...
 #
-# Note that typically each comment block is followed by some source
-# code declaration that may need to be kept in the reference.
+# Note that typically each comment block is followed by some source code
+# declaration that may need to be kept in the reference.
 #
-# Note that markers can alternatively be written as "@MARKER:"
-# instead of "<MARKER>". All marker identifiers are converted to
-# lower case during parsing in order to simply sorting.
+# Note that markers can alternatively be written as "@MARKER:" instead of
+# "<MARKER>".  All marker identifiers are converted to lower case during
+# parsing in order to simply sorting.
 #
-# We associate with each block the following source lines that do not
-# begin with a comment. For example, the following:
+# We associate with each block the following source lines that do not begin
+# with a comment.  For example, the following:
 #
 #   /**********************************
 #    *
@@ -211,38 +213,37 @@ def html_format( line )
 #    *
 #    */
 #
-#    bla_bla_bla
-#     bilip_bilip
+#   bla_bla_bla
+#   bilip_bilip
 #
 #   /* - this comment acts as a separator - */
 #
-#     blo_blo_blo
+#   blo_blo_blo
 #
 #
-#  will only keep the first two lines of sources with
-#  the "blabla" block.
+# will only keep the first two lines of sources with
+# the "blabla" block.
 #
-#  However, the comment will be kept, with following source lines
-#  if it contains a starting '#' or '@' as in:
+# However, the comment will be kept, with following source lines if it
+# contains a starting '#' or '@' as in:
 #
-#     /*@.....*/
-#     /*#.....*/
-#     /* @.....*/
-#     /* #.....*/
+#   /*@.....*/
+#   /*#.....*/
+#   /* @.....*/
+#   /* #.....*/
 #
 
 
 
 #############################################################################
 #
-# The DocCode class is used to store source code lines
+# The DocCode class is used to store source code lines.
 #
-#   'self.lines' contains a set of source code lines that will
-#   be dumped as HTML in a <PRE> tag.
+#   'self.lines' contains a set of source code lines that will be dumped as
+#   HTML in a <PRE> tag.
 #
-#   The object is filled line by line by the parser; it strips the
-#   leading "margin" space from each input line before storing it
-#   in 'self.lines'.
+#   The object is filled line by line by the parser; it strips the leading
+#   "margin" space from each input line before storing it in 'self.lines'.
 #
 class DocCode:
 
@@ -278,11 +279,11 @@ class DocCode:
         while l > 0 and string.strip( self.lines[l - 1] ) == "":
             l = l - 1
 
-        # the code footer should be directly appended to the last code
-        # line to avoid an additional blank line
+        # The code footer should be directly appended to the last code
+        # line to avoid an additional blank line.
         #
         sys.stdout.write( code_header )
-        for line in self.lines[0 : l+1]:            
+        for line in self.lines[0 : l+1]:
             sys.stdout.write( '\n' + html_format(line) )
         sys.stdout.write( code_footer )
 
@@ -370,8 +371,9 @@ class DocParagraph:
 
             cursor = cursor + len( word ) + 1
 
-            # handle trailing periods, commas, etc. at the end of
-            # cross references.
+
+            # Handle trailing periods, commas, etc. at the end of cross
+            # references.
             #
             if extra:
                 if cursor + len( extra ) + 1 > max_width:
@@ -410,10 +412,9 @@ class DocParagraph:
 #
 # DocContent is used to store the content of a given marker.
 #
-# The "self.items" list contains (field,elements) records, where
-# "field" corresponds to a given structure fields or function
-# parameter (indicated by a "::"), or NULL for a normal section
-# of text/code.
+# The "self.items" list contains (field,elements) records, where "field"
+# corresponds to a given structure fields or function parameter (indicated
+# by a "::"), or NULL for a normal section of text/code.
 #
 # Hence, the following example:
 #
@@ -436,8 +437,8 @@ class DocParagraph:
 #
 # in 'self.items'.
 #
-# The DocContent object is entirely built at creation time; you must
-# pass a list of input text lines in the "lines_list" parameter.
+# The DocContent object is entirely built at creation time; you must pass a
+# list of input text lines in the "lines_list" parameter.
 #
 class DocContent:
 
@@ -449,7 +450,7 @@ class DocContent:
         paragraph   = None   # represents the current DocParagraph
         code        = None   # represents the current DocCode
 
-        elements    = []     # the list of elements for the current field,
+        elements    = []     # the list of elements for the current field;
                              # contains DocParagraph or DocCode objects
 
         field       = None   # the current field
@@ -633,20 +634,18 @@ class DocContent:
 
 #############################################################################
 #
-#
-# The DocBlock class is used to store a given comment block. It contains
+# The DocBlock class is used to store a given comment block.  It contains
 # a list of markers, as well as a list of contents for each marker.
 #
-#   "self.items" is a list of (marker, contents) elements, where
-#   'marker' is a lowercase marker string, and 'contents' is a DocContent
-#   object.
+#   "self.items" is a list of (marker, contents) elements, where 'marker' is
+#   a lowercase marker string, and 'contents' is a DocContent object.
 #
-#   "self.source" is simply a list of text lines taken from the
-#   uncommented source itself.
+#   "self.source" is simply a list of text lines taken from the uncommented
+#   source itself.
 #
 #   Finally, "self.name" is a simple identifier used to uniquely identify
-#   the block. It is taken from the first word of the first
-#   paragraph of the first marker of a given block, i.e:
+#   the block. It is taken from the first word of the first paragraph of the
+#   first marker of a given block, i.e:
 #
 #      <Type> Goo
 #      <Description> Bla bla bla
@@ -708,6 +707,7 @@ class DocBlock:
 
 
     # This function adds a new element to 'self.items'.
+    #
     #   'marker' is a marker string, or None.
     #   'lines'  is a list of text lines used to compute a list of
     #            DocContent objects.
@@ -726,7 +726,7 @@ class DocBlock:
             l     = len( lines )
 
         # add a new marker only if its marker and its content list
-        # aren't empty
+        # are not empty
         #
         if l > 0 and marker:
             content = DocContent( lines )
@@ -931,14 +931,13 @@ class DocSectionList:
         abstract = block.find_content( "abstract" )
 
         if self.sections.has_key( name ):
-            # There is already a section with this name in our
-            # list. We will try to complete it.
+            # There is already a section with this name in our list.  We
+            # will try to complete it.
             #
             section = self.sections[name]
             if section.abstract:
-                # This section already has an abstract defined;
-                # simply check that the new section doesn't
-                # provide a new one.
+                # This section already has an abstract defined; simply check
+                # that the new section doesn't provide a new one.
                 #
                 if abstract:
                     section.block.print_error(
@@ -949,8 +948,8 @@ class DocSectionList:
                       "second definition in " +
                       "'" + block.location() + "'" )
             else:
-                # The old section didn't contain an abstract; we are
-                # now going to replace it.
+                # The old section didn't contain an abstract; we are now
+                # going to replace it.
                 #
                 section.abstract    = abstract
                 section.description = block.find_content( "description" )
@@ -979,8 +978,8 @@ class DocSectionList:
 
 
     def prepare_files( self, file_prefix = None ):
-        # prepare the section list, by computing section filenames
-        # and the index
+        # prepare the section list, by computing section filenames and the
+        # index
         #
         if file_prefix:
             prefix = file_prefix + "-"
@@ -996,8 +995,8 @@ class DocSectionList:
             else:
                 section.title = "UNKNOWN_SECTION_TITLE!"
 
-        # sort section elements according to the <order> marker if
-        # available
+
+        # sort section elements according to the <order> marker if available
         #
         for section in self.sections.values():
             order = section.block.find_content( "order" )
@@ -1101,7 +1100,7 @@ class DocSectionList:
 
 
 
-# Filter a given list of DocBlocks. Returns a new list of DocBlock objects
+# Filter a given list of DocBlocks.  Returns a new list of DocBlock objects
 # that only contains element whose "type" (i.e. first marker) is in the
 # "types" parameter.
 #
@@ -1152,7 +1151,8 @@ class DocDocument:
         if block.name:
             content = block.find_content( "chapter" )
             if content:
-                # it's a chapter definition -- add it to our list
+                # a chapter definition -- add it to our list
+                #
                 chapter = DocChapter( block )
                 self.chapters.append( chapter )
             else:
@@ -1216,6 +1216,7 @@ class DocDocument:
             print chapter_footer
 
         # list lost sections
+        #
         if self.lost_sections:
             print chapter_header + "OTHER SECTIONS:" + chapter_inter
 
@@ -1234,6 +1235,7 @@ class DocDocument:
             print chapter_footer
 
         # index
+        #
         print chapter_header + '<a href="' + self.section_list.index_filename + '">Index</a>' + chapter_footer
 
         print html_footer
@@ -1265,8 +1267,8 @@ def filter_section_blocks( block ):
     return block.section != None
 
 
-# Perform a lexicographical comparison of two DocBlock
-# objects. Returns -1, 0 or 1.
+# Perform a lexicographical comparison of two DocBlock objects.  Returns -1,
+# 0 or 1.
 #
 def block_lexicographical_compare( b1, b2 ):
     if not b1.name:
@@ -1285,7 +1287,7 @@ def block_lexicographical_compare( b1, b2 ):
         return 1
 
 
-# dump a list block as a single HTML page
+# Dump a list block as a single HTML page.
 #
 def dump_html_1( block_list ):
     print html_header
@@ -1349,7 +1351,7 @@ def make_block_list():
     #  1 - parse comment format 1
     #  2 - parse comment format 2
     #
-    #  4 - wait for beginning of source (or comment ??)
+    #  4 - wait for beginning of source (or comment?)
     #  5 - process source
     #
     comment = []
@@ -1414,15 +1416,15 @@ def make_block_list():
         #
         elif format == 1:
 
-            # If the line doesn't begin with a "*", something went
-            # wrong, and we must exit, and forget the current block.
+            # If the line doesn't begin with a "*", something went wrong,
+            # and we must exit, and forget the current block.
             #
             if l == 0 or line2[0] != '*':
                 block  = []
                 format = 0
 
-            # Otherwise, we test for an end of block, which is an
-            # arbitrary number of '*', followed by '/'.
+            # Otherwise, we test for an end of block, which is an arbitrary
+            # number of '*', followed by '/'.
             #
             else:
                 i = 1
@@ -1449,8 +1451,8 @@ def make_block_list():
         #
         elif format == 2:
 
-            # If the line doesn't begin with '/*' and end with '*/',
-            # this is the end of the format 2 format.
+            # If the line doesn't begin with '/*' and end with '*/', this is
+            # the end of the format 2 format.
             #
             if l < 4 or line2[: 2] != '/*' or line2[-2 :] != '*/':
                 if block != []:
@@ -1538,7 +1540,7 @@ def main( argv ):
 ##    section_list.dump_html_index()
 
 
-# If called from the command line
+# if called from the command line
 #
 if __name__ == '__main__':
     main( sys.argv )
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index 3983783..c11d82e 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -342,11 +342,12 @@
   /*                                                                       */
   /* @description:                                                         */
   /*    A macro used in #include statements to name the file containing    */
-  /*    a small useful API to handle bezier arcs. Note that you _must_     */
-  /*    include FT_FREETYPE_H or FT_IMAGE_H before this header..           */
+  /*    a small useful API to handle bezier arcs.  Note that you _must_    */
+  /*    include FT_FREETYPE_H or FT_IMAGE_H before this header.            */
   /*                                                                       */
 #define FT_BEZIER_H  <freetype/ftbezier.h>
 
+
   /*************************************************************************/
   /*                                                                       */
   /* @macro:                                                               */
diff --git a/include/freetype/internal/ftcalc.h b/include/freetype/internal/ftcalc.h
index 14f2f61..cc4f5af 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -146,10 +146,10 @@ FT_BEGIN_HEADER
                                        FT_Int32   y );
 
 
-#ifdef FT_CONFIG_OPTION_OLD_CALCS
-
   FT_EXPORT( FT_Int32 )  FT_SqrtFixed( FT_Int32  x );
 
+#ifdef FT_CONFIG_OPTION_OLD_CALCS
+
 #define SQRT_64( z )  FT_Sqrt64( &z )
 
   /*************************************************************************/
diff --git a/src/base/ftbbox.c b/src/base/ftbbox.c
index 2c9e0ff..091a7bb 100644
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -28,6 +28,7 @@
 #include FT_BBOX_H
 #include FT_IMAGE_H
 #include FT_OUTLINE_H
+#include FT_INTERNAL_CALC_H
 
 
   typedef struct  TBBox_Rec_
@@ -36,7 +37,7 @@
     FT_BBox    bbox;
 
   } TBBox_Rec;
-                          
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -214,7 +215,7 @@
                           FT_Pos*  min,
                           FT_Pos*  max )
   {
-    FT_Pos  stack[32*3+1], *arc;
+    FT_Pos  stack[32*3 + 1], *arc;
 
 
     arc = stack;
@@ -253,7 +254,7 @@
         }
       }
 
-      /* Unknown direction - split the arc in two */
+      /* Unknown direction -- split the arc in two */
       arc[6] = y4;
       arc[1] = y1 = ( y1 + y2 ) / 2;
       arc[5] = y4 = ( y4 + y3 ) / 2;
@@ -285,15 +286,28 @@
                    FT_Pos*   min,
                    FT_Pos*   max )
   {
-    FT_Pos   a = y4 - 3*y3 + 3*y2 - y1;
-    FT_Pos   b = y3 - 2*y2 + y1;
-    FT_Pos   c = y2 - y1;
-    FT_Pos   d = y1;
-    FT_Pos   y;
-    FT_Fixed uu;
-    
-    /* the polynom is "a*x^3 + 3b*x^2 + 3c*x + d", however, we also   */
-    /* have dP/dx(u) = 0, which implies that P(u) = b*u^2 + 2c*u + d  */
+ /* FT_Pos    a = y4 - 3*y3 + 3*y2 - y1; */
+    FT_Pos    b = y3 - 2*y2 + y1;
+    FT_Pos    c = y2 - y1;
+    FT_Pos    d = y1;
+    FT_Pos    y;
+    FT_Fixed  uu;
+
+    FT_UNUSED ( y4 );
+
+
+    /* The polynom is                       */
+    /*                                      */
+    /*   a*x^3 + 3b*x^2 + 3c*x + d      .   */
+    /*                                      */
+    /* However, we also have                */
+    /*                                      */
+    /*   dP/dx(u) = 0       ,               */
+    /*                                      */
+    /* which implies that                   */
+    /*                                      */
+    /*   P(u) = b*u^2 + 2c*u + d            */
+
     if ( u > 0 && u < 0x10000L )
     {
       uu = FT_MulFix( u, u );
@@ -316,7 +330,7 @@
     /* always compare first and last points */
     if      ( y1 < *min )  *min = y1;
     else if ( y1 > *max )  *max = y1;
-    
+
     if      ( y4 < *min )  *min = y4;
     else if ( y4 > *max )  *max = y4;
 
@@ -334,47 +348,48 @@
         return;
     }
 
-    /* there are some split points, now, find them.. */
+    /* There are some split points.  Find them. */
     {
       FT_Pos    a = y4 - 3*y3 + 3*y2 - y1;
       FT_Pos    b = y3 - 2*y2 + y1;
       FT_Pos    c = y2 - y1;
-      FT_Pos    d, t1;
+      FT_Pos    d;
       FT_Fixed  t;
-      
-      /* we need to solve "ax˛+2bx+c" here, without floating points !!     */
-      /* the trick is to normalize to a different representation in order  */
-      /* to use our 16.16 fixed point routines..                           */
+
+
+      /* we need to solve "ax^2+2bx+c" here, without floating points!      */
+      /* The trick is to normalize to a different representation in order  */
+      /* to use our 16.16 fixed point routines.                            */
       /*                                                                   */
-      /* we're going to compute FT_MulFix(b,b) and FT_MulFix(a,c) after    */
-      /* the normalisation. these values must fit in a single 16.16        */
+      /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after the            */
+      /* the normalization.  These values must fit into a single 16.16     */
       /* value.                                                            */
       /*                                                                   */
-      /* we normalize a, b and c to "8.16" fixed float values to ensure    */
-      /* that their product is held in a "16.16" value..                   */
+      /* We normalize a, b, and c to "8.16" fixed float values to ensure   */
+      /* that their product is held in a "16.16" value.                    */
       /*                                                                   */
       {
         FT_ULong  t1, t2;
         int       shift = 0;
-        
+
+
         t1  = (FT_ULong)((a >= 0) ? a : -a );
         t2  = (FT_ULong)((b >= 0) ? b : -b );
         t1 |= t2;
         t2  = (FT_ULong)((c >= 0) ? c : -c );
         t1 |= t2;
-        
-        if ( t1 == 0 )  /* all coefficients are 0 !! */
+
+        if ( t1 == 0 )  /* all coefficients are 0! */
           return;
-        
+
         if ( t1 > 0xFFFFFFL )
         {
           do
           {
             shift--;
             t1 >>= 1;
-          }
-          while ( t1 > 0xFFFFFFL );
-          
+          } while ( t1 > 0xFFFFFFL );
+
           a >>= shift;
           b >>= shift;
           c >>= shift;
@@ -385,9 +400,8 @@
           {
             shift++;
             t1 <<= 1;
-          }
-          while ( t1 < 0x800000L );
-          
+          } while ( t1 < 0x800000L );
+
           a <<= shift;
           b <<= shift;
           c <<= shift;
@@ -399,7 +413,7 @@
       {
         if ( b != 0 )
         {
-          t = - FT_DivFix( c, b )/2;
+          t = - FT_DivFix( c, b ) / 2;
           test_cubic_zero( y1, y2, y3, y4, t, min, max );
         }
       }
@@ -412,23 +426,23 @@
 
         if ( d == 0 )
         {
-          /* there is a single split point, at -b/a */
+          /* there is a single split point at -b/a */
           t = - FT_DivFix( b, a );
           test_cubic_zero( y1, y2, y3, y4, t, min, max );
         }
         else
         {
-          /* there are two solutions, we need to filter them though */
+          /* there are two solutions; we need to filter them though */
           d = FT_SqrtFixed( (FT_Int32)d );
           t = - FT_DivFix( b - d, a );
           test_cubic_zero( y1, y2, y3, y4, t, min, max );
-          
+
           t = - FT_DivFix( b + d, a );
           test_cubic_zero( y1, y2, y3, y4, t, min, max );
         }
       }
     }
- }
+  }
 
 #endif
 
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 57b4067..2399a11 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -239,50 +239,49 @@
               FT_UInt32  y,
               FT_Int64  *z )
   {
-    {
-      FT_UInt32  lo1, hi1, lo2, hi2, lo, hi, i1, i2;
+    FT_UInt32  lo1, hi1, lo2, hi2, lo, hi, i1, i2;
 
 
-      lo1 = x & 0x0000FFFFU;  hi1 = x >> 16;
-      lo2 = y & 0x0000FFFFU;  hi2 = y >> 16;
+    lo1 = x & 0x0000FFFFU;  hi1 = x >> 16;
+    lo2 = y & 0x0000FFFFU;  hi2 = y >> 16;
 
-      lo = lo1 * lo2;
-      i1 = lo1 * hi2;
-      i2 = lo2 * hi1;
-      hi = hi1 * hi2;
+    lo = lo1 * lo2;
+    i1 = lo1 * hi2;
+    i2 = lo2 * hi1;
+    hi = hi1 * hi2;
 
-      /* Check carry overflow of i1 + i2 */
-      i1 += i2;
-	  hi += (FT_UInt32)( i1 < i2 ) << 16;
+    /* Check carry overflow of i1 + i2 */
+    i1 += i2;
+    hi += (FT_UInt32)( i1 < i2 ) << 16;
 
-      hi += i1 >> 16;
-      i1  = i1 << 16;
+    hi += i1 >> 16;
+    i1  = i1 << 16;
 
-      /* Check carry overflow of i1 + lo */
-      lo += i1;
-      hi += ( lo < i1 );
+    /* Check carry overflow of i1 + lo */
+    lo += i1;
+    hi += ( lo < i1 );
 
-      z->lo = lo;
-      z->hi = hi;
-    }
+    z->lo = lo;
+    z->hi = hi;
   }
 
 
   static FT_UInt32
   ft_div64by32( FT_UInt32  hi,
                 FT_UInt32  lo,
-				FT_UInt32  y )
+                FT_UInt32  y )
   {
     FT_UInt  r, q;
-	FT_Int   i;
-	
+    FT_Int   i;
+
+
     q = 0;
-	r = hi;
-	
-	if ( r >= y )
-	  return (FT_UInt32)0x7FFFFFFF;
-	  
-	i = 32;
+    r = hi;
+
+    if ( r >= y )
+      return (FT_UInt32)0x7FFFFFFFL;
+
+    i = 32;
     do
     {
       r <<= 1;
@@ -295,10 +294,9 @@
         q |= 1;
       }
       lo <<= 1;
-    }
-	while (--i);
-	
-	return q;
+    } while ( --i );
+
+    return q;
   }
 
 
@@ -310,6 +308,7 @@
   {
     register FT_UInt32  lo, hi, max;
 
+
     max = x->lo > y->lo ? x->lo : y->lo;
     lo  = x->lo + y->lo;
     hi  = x->hi + y->hi + ( lo < max );
@@ -319,15 +318,13 @@
   }
 
 
-
-
   /* documentation is in freetype.h */
 
   FT_EXPORT_DEF( FT_Long )  FT_MulDiv( FT_Long  a,
                                        FT_Long  b,
                                        FT_Long  c )
   {
-    long   s;
+    long  s;
 
 
     if ( a == 0 || b == c )
@@ -347,10 +344,10 @@
 
 
       ft_multo64( a, b, &temp );
-	  
-	  temp2.hi = 0;
-	  temp2.lo = (FT_UInt32)(c >> 1);
-	  FT_Add64( &temp, &temp2, &temp );
+
+      temp2.hi = 0;
+      temp2.lo = (FT_UInt32)(c >> 1);
+      FT_Add64( &temp, &temp2, &temp );
       a = ft_div64by32( temp.hi, temp.lo, b );
     }
     else
@@ -440,13 +437,14 @@
                                      FT_Int32   y,
                                      FT_Int64  *z )
   {
-    FT_Int32   s;
+    FT_Int32  s;
 
 
     s  = x; x = ABS( x );
     s ^= y; y = ABS( y );
 
     ft_multo64( x, y, z );
+
     if ( s < 0 )
     {
       z->lo = (FT_UInt32)-(FT_Int32)z->lo;
@@ -476,7 +474,7 @@
     if ( x->hi == 0 )
     {
       if ( y > 0 )
-        q = (x->lo + (y >> 1)) / y;
+        q = ( x->lo + ( y >> 1 ) ) / y;
       else
         q = 0x7FFFFFFFL;
 
@@ -484,6 +482,7 @@
     }
 
     q = ft_div64by32( x->hi, x->lo, y );
+
     return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q );
   }
 
@@ -563,20 +562,20 @@
   }
 
 
-
 #endif /* FT_CONFIG_OPTION_OLD_CALCS */
 
 
-
 #endif /* FT_LONG64 */
 
 
- /* a not-so-fast but working 16.16 fixed point square root function */
+  /* a not-so-fast but working 16.16 fixed point square root function */
+
   FT_EXPORT_DEF( FT_Int32 )  FT_SqrtFixed( FT_Int32  x )
   {
     FT_UInt32  root, rem_hi, rem_lo, test_div;
     FT_Int     count;
 
+
     root = 0;
 
     if ( x > 0 )
@@ -584,19 +583,19 @@
       rem_hi = 0;
       rem_lo = x;
       count  = 24;
-	  do
+      do
       {
-        rem_hi   = (rem_hi << 2) | (rem_lo >> 30);
+        rem_hi   = ( rem_hi << 2 ) | ( rem_lo >> 30 );
         rem_lo <<= 2;
         root   <<= 1;
-        test_div = (root << 1) + 1;
+        test_div = ( root << 1 ) + 1;
+
         if ( rem_hi >= test_div )
         {
           rem_hi -= test_div;
           root   += 1;
         }
-      }
-	  while (--count);
+      } while ( --count );
     }
 
     return (FT_Int32)root;
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index d6e759c..fa2ef77 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -247,7 +247,7 @@
 
     TScan  last_ey;
 
-    FT_Vector   bez_stack[32 * 3+1];
+    FT_Vector   bez_stack[32 * 3 + 1];
     int         lev_stack[32];
 
     FT_Outline  outline;