[med-svn] [mricron] 01/01: Fix FTBFS Illegal type conversion

Andreas Tille tille at debian.org
Sat Jan 14 15:43:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository mricron.

commit 800fb45bcff88748bd973a7b11afa25aa6c4588c
Author: Andreas Tille <tille at debian.org>
Date:   Sat Jan 14 16:27:47 2017 +0100

    Fix FTBFS  Illegal type conversion
---
 debian/changelog                  |  3 +++
 debian/patches/series             |  1 +
 debian/patches/stricter_fpc.patch | 53 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 59e4b7c..9610fa2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ mricron (0.20140804.1~dfsg.1-2) UNRELEASED; urgency=medium
   * Priority: optional
   * debhelper 10
   * DEP5
+  * Fix FTBFS  Illegal type conversion (Thanks for the patch to
+    Michalis Kamburelis <michalis.kambi at gmail.com>)
+    Closes: #813718
 
  -- Andreas Tille <tille at debian.org>  Mon, 02 Jan 2017 22:47:56 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index 295a993..6f528bf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ syntax_fixes
 lazarus_modern
 debian_paths
 debian_version
+stricter_fpc.patch
diff --git a/debian/patches/stricter_fpc.patch b/debian/patches/stricter_fpc.patch
new file mode 100644
index 0000000..d625bc9
--- /dev/null
+++ b/debian/patches/stricter_fpc.patch
@@ -0,0 +1,53 @@
+From: Michalis Kamburelis <michalis.kambi at gmail.com>
+Bug-Debian: https://bugs.debian.org/813718
+Subject: Fix FTBFS: dialogsx.pas(77, 14) Error: (4054) Illegal type conversion: "TMsgDlgButtons" to "TMsgDlgButtons"
+Last-Upate: Sat, 6 Feb 2016 15:45:38 +0100
+
+--- a/common/dialogsx.pas
++++ b/common/dialogsx.pas
+@@ -66,6 +66,36 @@ begin
+ end;
+ {$ENDIF}
+ 
++{ Convert our TMsgDlgButtons type to Dialogs.TMsgDlgButtons type
++  in a type-safe manner. Do not assume that memory layout matches between
++  - TMsgDlgButtons and Dialogs.TMsgDlgButtons, or
++  - TMsgDlgBtn and Dialogs.TMsgDlgBtn. 
++}
++function MsgDlgButtonsConvertToStandard(
++  const Buttons: TMsgDlgButtons): Dialogs.TMsgDlgButtons;
++var
++  B: TMsgDlgBtn;
++begin
++  Result := [];
++  for B := Low(B) to High(B) do
++    if B in Buttons then
++      { convert our TMsgDlgBtn to Dialogs.TMsgDlgBtn type }
++      case B of
++        mbYes     : Include(Result, Dialogs.mbYes     );
++        mbNo      : Include(Result, Dialogs.mbNo      );
++        mbOK      : Include(Result, Dialogs.mbOK      );
++        mbCancel  : Include(Result, Dialogs.mbCancel  );
++        mbAbort   : Include(Result, Dialogs.mbAbort   );
++        mbRetry   : Include(Result, Dialogs.mbRetry   );
++        mbIgnore  : Include(Result, Dialogs.mbIgnore  );
++        mbAll     : Include(Result, Dialogs.mbAll     );
++        mbNoToAll : Include(Result, Dialogs.mbNoToAll );
++        mbYesToAll: Include(Result, Dialogs.mbYesToAll);
++        mbHelp    : Include(Result, Dialogs.mbHelp    );
++        else raise Exception.Create('Unsupported TMsgDlgBtn value');
++      end;
++end;
++
+ function MsgDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;
+ {$IFDEF GUI}
+ var
+@@ -74,7 +104,7 @@ var
+ 
+ begin
+   lDlgType :=  Dialogs.TMsgDlgType(DlgType);
+-  lButtons:= Dialogs.TMsgDlgButtons(Buttons);
++  lButtons:= MsgDlgButtonsConvertToStandard(Buttons);
+   result := MessageDlg(Msg, lDlgType, lButtons,HelpCtx);
+ {$ELSE}
+ begin

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/mricron.git



More information about the debian-med-commit mailing list