[commit: packages/Win32] master: Nullable pointers now wrapped in Maybe (#83) (73a7b78)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:29:04 UTC 2017


Repository : ssh://git@git.haskell.org/Win32

On branch  : master
Link       : http://git.haskell.org/packages/Win32.git/commitdiff/73a7b785c0683f0a3354ddf54d8d5eeeca909370

>---------------------------------------------------------------

commit 73a7b785c0683f0a3354ddf54d8d5eeeca909370
Author: Ahmad Fatoum <ahmad at a3f.at>
Date:   Tue Mar 28 08:06:41 2017 +0200

    Nullable pointers now wrapped in Maybe (#83)
    
    A fix for Issue #24
    
    A number of WinAPI functions have a default action,
    when NULL is passed in place of a valid pointer, mostly strings.
    We now use Maybe wrapped types for these arguments.
    
    This breaks API. In total 15 functions were amended:
    appendMenu
    insertMenu
    modifyMenu
    messageBox
    findWindow
    findWindowEx
    moveFileEx
    setDllDirectory
    defineDosDevice
    setVolumeLabel
    getVolumeInformation
    searchPath
    regCreateKeyEx
    regReplaceKey
    getTimeFormat
    
    And 2 functions' Maybe was removed because passing in Nothing was equal to Just "":
    RegQueryValue
    RegQueryValueKey
    
    createWindow[Ex] can also have NULL as HINSTANCE. As HINSTANCE is a pointer anyway,
    we'll provide a nullHINSTANCE instead of breaking this function's API too


>---------------------------------------------------------------

73a7b785c0683f0a3354ddf54d8d5eeeca909370
 Graphics/Win32/Menu.hsc   | 12 ++++++------
 Graphics/Win32/Misc.hsc   |  4 ++--
 Graphics/Win32/Window.hsc | 19 ++++++++++---------
 System/Win32/DLL.hsc      |  7 ++++---
 System/Win32/File.hsc     | 14 +++++++-------
 System/Win32/HardLink.hs  |  6 +++---
 System/Win32/Info.hsc     |  6 +++---
 System/Win32/Registry.hsc | 24 ++++++++++++------------
 System/Win32/Time.hsc     |  7 ++++---
 System/Win32/Types.hsc    |  3 +++
 changelog.md              |  1 +
 tests/registry001.hs      |  2 +-
 12 files changed, 56 insertions(+), 49 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 73a7b785c0683f0a3354ddf54d8d5eeeca909370


More information about the ghc-commits mailing list