View Issue Details

IDProjectCategoryView StatusLast Update
0038977LazarusLCLpublic2021-06-11 12:24
ReporterDavid Assigned ToMaxim Ganetsky  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
OSlinux 
Product Version2.1 (SVN) 
Fixed in Version2.2 
Summary0038977: Spelling Mistake
DescriptionOK, sounds pedantic (and I am a poor speller myself). But when I submit my app to Debian, they scan the binary for "frequently mis-spellings". And "occured" comes up in binaries linked to GTK2.
Attached are four patches that fix the ones that are, or might be detected. I have addressed only ones where text is stored in the binary (as a warning or error message), not Identifiers.
Steps To ReproduceRun strings some_gtk2_binary | grep occured [enter]
Additional InformationI have provide four separate patches because I, myself, am always uncomfortable using patches that cover more than one file. Sorry if you don't share my conservatism. None of the patches change anything other than string literals, obviously no dependencies between them.

As well as dealing with some in GTK2 (two files) I have also dealt with two of the same problems in components/opengl, while not of personal interest to me, need fixing.

There are still some similar errors in GTK (1) but I don't think that will be an issue for anyone.



TagsNo tags attached.
Fixed in Revision65192 - 65212
LazTarget-
Widgetset
Attached Files

Activities

David

2021-06-08 08:29

reporter  

glgtkglxcontext.patch (566 bytes)   
--- ./components/opengl/glgtkglxcontext.pas-old	2021-06-08 15:44:53.589080710 +1000
+++ ./components/opengl/glgtkglxcontext.pas	2021-06-08 15:46:33.904410560 +1000
@@ -602,7 +602,7 @@
 function CustomXErrorHandler({%H-}para1:PDisplay; para2:PXErrorEvent):cint;cdecl;
 begin
   if para2^.error_code=8 then begin
-    raise Exception.Create('A BadMatch X error occured. Most likely the requested OpenGL version is invalid.');
+    raise Exception.Create('A BadMatch X error occurred. Most likely the requested OpenGL version is invalid.');
   end;
   Result:=0;
 end;
glgtkglxcontext.patch (566 bytes)   
glqtcontext.patch (558 bytes)   
--- ./components/opengl/glqtcontext.pas-old	2021-06-08 15:45:20.973432006 +1000
+++ ./components/opengl/glqtcontext.pas	2021-06-08 15:45:46.993800583 +1000
@@ -266,7 +266,7 @@
 function CustomXErrorHandler({%H-}para1:PDisplay; para2:PXErrorEvent):cint;cdecl;
 begin
   if para2^.error_code=8 then begin
-    raise Exception.Create('A BadMatch X error occured. Most likely the requested OpenGL version is invalid.');
+    raise Exception.Create('A BadMatch X error occurred. Most likely the requested OpenGL version is invalid.');
   end;
   Result:=0;
 end;
glqtcontext.patch (558 bytes)   
gtk2proc.patch (558 bytes)   
--- lcl/interfaces/gtk2/gtk2proc.inc-old	2021-06-08 15:32:47.042482703 +1000
+++ lcl/interfaces/gtk2/gtk2proc.inc	2021-06-08 15:37:05.265922633 +1000
@@ -250,7 +250,7 @@
   {$IFDEF VerboseGtkToDos}{$note TODO: enable standard error_log handling}{$ENDIF}
   {$IfDef REPORT_GDK_ERRORS}
   If (Xerror<>0) then
-    RaiseGDBException('A GDK/X Error occured, this is normally fatal. The error code was : ' + IntToStr(Xerror));
+    RaiseGDBException('A GDK/X Error occurred, this is normally fatal. The error code was : ' + IntToStr(Xerror));
   {$EndIf}
 end;
 
gtk2proc.patch (558 bytes)   
gtk2winapi.patch (1,104 bytes)   
--- lcl/interfaces/gtk2/gtk2winapi.inc-old	2021-06-08 15:32:25.761702999 +1000
+++ lcl/interfaces/gtk2/gtk2winapi.inc	2021-06-08 15:34:32.881914403 +1000
@@ -812,7 +812,7 @@
     try
       if not gdk_pixbuf_loader_write(Loader, TGdkPixBufBuffer(@Header), MIN_LOADER_HEADER_SIZE,nil)
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Bitmap Header!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Bitmap Header!');
         Exit;
       end;
       
@@ -839,14 +839,14 @@
     
       if not res
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Image!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Image!');
         Exit;
       end;
 
       Src := gdk_pixbuf_loader_get_pixbuf(loader);
       if Src = nil
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Pixbuf!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Pixbuf!');
         Exit;
       end;
 
gtk2winapi.patch (1,104 bytes)   

Bart Broersma

2021-06-08 10:11

developer   ~0131197

Last edited: 2021-06-08 10:13

View 2 revisions

Don't worry: this is by no means pedantic.
Since this is bout spelling mistakes and there are no functional changes, could you perhaps submit this as one patch?

David

2021-06-09 01:11

reporter   ~0131207

OK, Bart, here is a new patch, occured.patch.

It should be used from the top level lazarus directory, where you can see 'lcl' and 'components' for example.

patch -p0 < occured.patch
occured.patch (3,218 bytes)   
diff -ruN ../trunk-ref/./components/opengl/glgtkglxcontext.pas ./components/opengl/glgtkglxcontext.pas
--- ../trunk-ref/./components/opengl/glgtkglxcontext.pas	2021-06-09 10:37:21.803198529 +1000
+++ ./components/opengl/glgtkglxcontext.pas	2021-06-08 15:46:33.904410560 +1000
@@ -602,7 +602,7 @@
 function CustomXErrorHandler({%H-}para1:PDisplay; para2:PXErrorEvent):cint;cdecl;
 begin
   if para2^.error_code=8 then begin
-    raise Exception.Create('A BadMatch X error occured. Most likely the requested OpenGL version is invalid.');
+    raise Exception.Create('A BadMatch X error occurred. Most likely the requested OpenGL version is invalid.');
   end;
   Result:=0;
 end;
diff -ruN ../trunk-ref/./components/opengl/glqtcontext.pas ./components/opengl/glqtcontext.pas
--- ../trunk-ref/./components/opengl/glqtcontext.pas	2021-06-09 10:37:21.803198529 +1000
+++ ./components/opengl/glqtcontext.pas	2021-06-08 15:45:46.993800583 +1000
@@ -266,7 +266,7 @@
 function CustomXErrorHandler({%H-}para1:PDisplay; para2:PXErrorEvent):cint;cdecl;
 begin
   if para2^.error_code=8 then begin
-    raise Exception.Create('A BadMatch X error occured. Most likely the requested OpenGL version is invalid.');
+    raise Exception.Create('A BadMatch X error occurred. Most likely the requested OpenGL version is invalid.');
   end;
   Result:=0;
 end;
diff -ruN ../trunk-ref/./lcl/interfaces/gtk2/gtk2proc.inc ./lcl/interfaces/gtk2/gtk2proc.inc
--- ../trunk-ref/./lcl/interfaces/gtk2/gtk2proc.inc	2021-06-09 10:37:22.047202105 +1000
+++ ./lcl/interfaces/gtk2/gtk2proc.inc	2021-06-08 15:37:05.265922633 +1000
@@ -250,7 +250,7 @@
   {$IFDEF VerboseGtkToDos}{$note TODO: enable standard error_log handling}{$ENDIF}
   {$IfDef REPORT_GDK_ERRORS}
   If (Xerror<>0) then
-    RaiseGDBException('A GDK/X Error occured, this is normally fatal. The error code was : ' + IntToStr(Xerror));
+    RaiseGDBException('A GDK/X Error occurred, this is normally fatal. The error code was : ' + IntToStr(Xerror));
   {$EndIf}
 end;
 
diff -ruN ../trunk-ref/./lcl/interfaces/gtk2/gtk2winapi.inc ./lcl/interfaces/gtk2/gtk2winapi.inc
--- ../trunk-ref/./lcl/interfaces/gtk2/gtk2winapi.inc	2021-06-09 10:37:22.047202105 +1000
+++ ./lcl/interfaces/gtk2/gtk2winapi.inc	2021-06-08 15:34:32.881914403 +1000
@@ -812,7 +812,7 @@
     try
       if not gdk_pixbuf_loader_write(Loader, TGdkPixBufBuffer(@Header), MIN_LOADER_HEADER_SIZE,nil)
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Bitmap Header!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Bitmap Header!');
         Exit;
       end;
       
@@ -839,14 +839,14 @@
     
       if not res
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Image!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Image!');
         Exit;
       end;
 
       Src := gdk_pixbuf_loader_get_pixbuf(loader);
       if Src = nil
       then begin
-        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occured loading Pixbuf!');
+        DebugLn('WARNING: [TGtk2WidgetSet.CreateBitmap] Error occurred loading Pixbuf!');
         Exit;
       end;
 
occured.patch (3,218 bytes)   

Bart Broersma

2021-06-09 07:03

developer   ~0131211

Lines like: "diff -ruN ../trunk-ref/./lcl/interfaces/gtk2/gtk2winapi.inc ./lcl/interfaces/gtk2/gtk2winapi.inc" should not appear in a diff.

The easiest way to make the diff is (assuming you have svn installed): svn diff lcl/interfaces/gtk2 > occurred.diff (executed in the root directory of Lazarus).

David

2021-06-09 08:29

reporter   ~0131213

Bart, that line is generated by the normal diff command when diff-ing directories.

No, I don't use svn unless I have to, I get Lazarus Trunk from github. SVN and I do not get along well.

That header line is always ignored by the patch command, indeed, an example of it appears in the patch man page. I tested this individual patch and it worked as expected and generated no warnings or errors. See -

dbannon@dell:~/bin/Lazarus/trunk-git$ patch -p0 < ../occured.patch
patching file ./components/opengl/glgtkglxcontext.pas
patching file ./components/opengl/glqtcontext.pas
patching file ./lcl/interfaces/gtk2/gtk2proc.inc
patching file ./lcl/interfaces/gtk2/gtk2winapi.inc

I cannot find a switch to diff that turns the header off, I guess it would be feasible to manually edit the patch file but thats a bad (IMHO) practice.

Otherwise, all I can suggest is to use the individual patches, diff does not put the header in when diff-ing individual files.

Davo

Maxim Ganetsky

2021-06-10 23:04

developer   ~0131233

I fixed all 'occur' related typos in comments, debug lines, function/method and resource string names.

Please test and close if OK.

David

2021-06-11 12:24

reporter   ~0131255

Yep, thats fixed. Thanks Maxim and Bart.
Davo

David

2021-06-11 12:24

reporter   ~0131256

closed

Issue History

Date Modified Username Field Change
2021-06-08 08:29 David New Issue
2021-06-08 08:29 David File Added: glgtkglxcontext.patch
2021-06-08 08:29 David File Added: glqtcontext.patch
2021-06-08 08:29 David File Added: gtk2proc.patch
2021-06-08 08:29 David File Added: gtk2winapi.patch
2021-06-08 10:11 Bart Broersma Note Added: 0131197
2021-06-08 10:13 Bart Broersma Note Edited: 0131197 View Revisions
2021-06-08 10:13 Bart Broersma Assigned To => Bart Broersma
2021-06-08 10:13 Bart Broersma Status new => feedback
2021-06-08 10:13 Bart Broersma LazTarget => -
2021-06-09 01:11 David Note Added: 0131207
2021-06-09 01:11 David File Added: occured.patch
2021-06-09 01:11 David Status feedback => assigned
2021-06-09 07:03 Bart Broersma Status assigned => feedback
2021-06-09 07:03 Bart Broersma Note Added: 0131211
2021-06-09 08:29 David Note Added: 0131213
2021-06-09 08:29 David Status feedback => assigned
2021-06-10 23:04 Maxim Ganetsky Status assigned => resolved
2021-06-10 23:04 Maxim Ganetsky Resolution open => fixed
2021-06-10 23:04 Maxim Ganetsky Fixed in Version => 2.2
2021-06-10 23:04 Maxim Ganetsky Fixed in Revision => 65192 - 65212
2021-06-10 23:04 Maxim Ganetsky Widgetset GTK 2 =>
2021-06-10 23:04 Maxim Ganetsky Note Added: 0131233
2021-06-10 23:04 Maxim Ganetsky Assigned To Bart Broersma => Maxim Ganetsky
2021-06-11 12:24 David Note Added: 0131255
2021-06-11 12:24 David Status resolved => closed
2021-06-11 12:24 David Note Added: 0131256