From fd8d649f63adfd8f41b8dddce0872b689a549399 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Wed, 2 Oct 2024 16:16:09 -0400 Subject: [PATCH] Fix bad usage of static fields as calls --- CHANGELOG.md | 2 ++ src/clj/coffi/ffi.clj | 2 +- src/clj/coffi/mem.clj | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c34a0af..0732987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [UNRELEASED] +### Fixed +- Usage of deprecated `(Class/STATIC_FIELD)` access pattern ## [1.0.450] - 2024-10-02 ### Added diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index d3d770b..9263c45 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -292,7 +292,7 @@ ;; cast null pointers to something understood by panama (#{::mem/pointer} type) - `(or ~sym (MemorySegment/NULL)) + `(or ~sym MemorySegment/NULL) (mem/primitive-type type) `(mem/serialize* ~sym ~type-sym ~arena) diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index ec5e665..fcf3ecb 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -115,7 +115,7 @@ (defn null? "Checks if a memory address is null." [addr] - (or (.equals (MemorySegment/NULL) addr) (not addr))) + (or (.equals MemorySegment/NULL addr) (not addr))) (defn address? "Checks if an object is a memory address. @@ -872,7 +872,7 @@ (serialize-into obj (second type) segment arena) (address-of segment)) obj) - (MemorySegment/NULL))) + MemorySegment/NULL)) (defmethod serialize* ::void [_obj _type _arena] @@ -1132,7 +1132,7 @@ [obj _type ^Arena arena] (if obj (.allocateFrom arena ^String obj) - (MemorySegment/NULL))) + MemorySegment/NULL)) (defmethod deserialize* ::c-string [addr _type]