Displaying 20 results from an estimated 1418 matches for "accessors".
2023 Jun 21
3
[PATCH 00/79] fs: new accessors for inode->i_ctime
...time to ensure that bits used as flags are
appropriately handled.
This patchset first adds some new inode_ctime_* accessor functions. It
then converts all in-tree accesses of inode->i_ctime to use those new
functions and then renames the i_ctime field to __i_ctime to help ensure
that use of the accessors.
Most of this conversion was done via coccinelle, with a few of the more
non-standard accesses done by hand. There should be no behavioral
changes with this set. That will come later, as we convert individual
filesystems to use multigrain timestamps.
Some of these patches depend on the set I sent...
2010 Nov 17
2
Reference classes: accessor functions via 'getRefClass(...)$accessors(...)'
...()'' where I can actually decide between
static and dynamic runmode (so the method also wraps the call ''myObj$a'' for
the static runmode).
Now I saw that setting up such accessor methods (get/set) is already done
for me if I use ''getRefClass("Blabla")$accessors(.)''. I just don''t
understand what exactly I have to do there, because this results in an
error: ''getRefClass("Blabla")$accessors("a")''
Can anyone point me to the correct use of ''getRefClass(.)$accessors(.)''?
Thanks a...
2007 Sep 15
2
wxRuby 1.9.1 and id accessor consistency problem
Hi all,
wxRuby 1.9.1 introduced great Rubish style accessors (x.label as a synonym
for x.get_label).
I just found that get_id has no corresponding Rubish style id accessor.
For a CheckListBox or a StaticText (I haven''t checked for other kind of
controls), id just returns the Ruby object_id.
This is very confusing and not consistent with other acces...
2006 Sep 26
3
S4 accessors
I have a small S4 class for which I've written a page grouping many of
the accessors and replacement functions together. I would be interested
in people comments on the approach I've taken.
The code has a couple of decisions for which I could imagine
alternatives. First, even simple get/set operations on class elements
are wrapped in functions. I suppose I could just use my...
2006 Mar 02
1
Fixture accessors broken for polymorphism, in need of redesign
...or method
which is constructed by the fixture call can''t infer the class name
from the table name. The band-aid in 3935 was to allow you to define
the class in a table with set_fixture_class, but it won''t hold for
polymorphism.
We''re going to need to redesign the fixture accessors.
I''ll look at the code ASAP, but does anyone have suggestions on how to
go about it?
Kev
2006 Jul 31
2
Updating a belongs_to foreign key leaves the old association object available
Perhaps this is intentional, but it seems unlikely:
class Person < ActiveRecord::Base
belongs_to :school
end
p = Person.find(:first)
p.school # nil
p.school_id = School.find_by_name(''High School'').id
p.school.name # High School
p.school_id = School.find_by_name(''Primary School'').id
p.school.name # High School <= Shouldn''t this be Primary
2008 Sep 24
1
[LLVMdev] Accessor function setFPImm in MachineOperand
I need to modify the FPImmediate in the MachineOperand but there is no
accessor function for this variable. Any other way of doing this without
creating a new operand via CreateFPImm?
Micah Villmow
Systems Engineer
Advanced Technology & Performance
Advanced Micro Devices Inc.
4555 Great America Pkwy,
Santa Clara, CA. 95054
P: 408-572-6219
F: 408-572-6596
-------------- next part
2008 Feb 03
1
R class accessor problem in 2.6
...but in 2.6 it returns a
NULL.
# Start of accessor method for A
setMethod('$', '_p_A', function(x, name)
{
print('foo')
accessorFuns = list('i' = A_i_get, 'ui' = A_ui_get, 'd' = A_d_get, 'str' =
A_str_get, 'tmp' = A_tmp_get)
vaccessors = c('i', 'ui', 'd', 'str', 'tmp')
idx = pmatch(name, names(accessorFuns))
if(is.na(idx))
return(callNextMethod(x, name))
f = accessorFuns[[idx]]
formals(f)[[1]] = x
if (is.na(match(name, vaccessors))) f else f(x)
}
)
# end of accessor method fo...
2020 Jan 08
4
[RFT 00/13] iomap: Constify ioreadX() iomem argument
Le 08/01/2020 ? 09:18, Krzysztof Kozlowski a ?crit?:
> On Wed, 8 Jan 2020 at 09:13, Geert Uytterhoeven <geert at linux-m68k.org> wrote:
>>
>> Hi Krzysztof,
>>
>> On Wed, Jan 8, 2020 at 9:07 AM Geert Uytterhoeven <geert at linux-m68k.org> wrote:
>>> On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski <krzk at kernel.org> wrote:
>>>>
2012 Sep 09
2
mattr_accessor inside a class
Rails extends Ruby with mattr_accessor (Module accessor). As Ruby''s
attr_accessor generates getter/setter methods for instances,
mattr_accessor provide getter/setter methods at the module level. In
below example, you see that mattr_accessor declared in the class
context of LookupContext. It''s declared in class, not module. However,
modules are defined in LookupContext, for
2006 Mar 28
11
setting widget attributes
I''m trying to set attributes of widgets in subclasses like the following.
class PersonTable < FXTable
def initialize(owner)
options = TABLE_COL_SIZEABLE
super(owner, nil, 0, options)
visibleRows = 5
...
end
end
visibleRows doesn''t get set.
However, if I do this
self.visibleRows = 5
then it does.
Shouldn''t it work without "self."?
2015 Apr 07
0
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
The current memory accessors logic is:
- little endian if little_endian
- native endian (i.e. no byteswap) if !little_endian
If we want to fully support cross-endian vhost, we also need to be
able to convert to big endian.
Instead of changing the little_endian argument to some 3-value enum, this
patch changes the logic to:
-...
2015 Apr 10
0
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
The current memory accessors logic is:
- little endian if little_endian
- native endian (i.e. no byteswap) if !little_endian
If we want to fully support cross-endian vhost, we also need to be
able to convert to big endian.
Instead of changing the little_endian argument to some 3-value enum, this
patch changes the logic to:
-...
2015 Apr 24
0
[PATCH v6 6/8] virtio: add explicit big-endian support to memory accessors
The current memory accessors logic is:
- little endian if little_endian
- native endian (i.e. no byteswap) if !little_endian
If we want to fully support cross-endian vhost, we also need to be
able to convert to big endian.
Instead of changing the little_endian argument to some 3-value enum, this
patch changes the logic to:
-...
2020 Apr 28
0
[PATCH v3 02/75] KVM: SVM: Add GHCB Accessor functions
...ghcb)->save.valid_bitmap[byte_idx] |= BIT(bit_idx); \
+ }
+
+#define DEFINE_GHCB_SETTER(field) \
+ static inline void \
+ ghcb_set_##field(struct ghcb *ghcb, u64 value) \
+ { \
+ GHCB_SET_VALID(ghcb, field) \
+ (ghcb)->save.field = value; \
+ }
+
+#define DEFINE_GHCB_ACCESSORS(field) \
+ static inline bool ghcb_is_valid_##field(const struct ghcb *ghcb) \
+ { \
+ DEFINE_GHCB_INDICES(field) \
+ return !!((ghcb)->save.valid_bitmap[byte_idx] \
+ & BIT(bit_idx)); \
+ } \
+ \
+ static inline void \
+ ghcb_set_##field(struct ghcb...
2020 Jul 24
0
[PATCH v5 02/75] KVM: SVM: Add GHCB Accessor functions
...ghcb)->save.valid_bitmap[byte_idx] |= BIT(bit_idx); \
+ }
+
+#define DEFINE_GHCB_SETTER(field) \
+ static inline void \
+ ghcb_set_##field(struct ghcb *ghcb, u64 value) \
+ { \
+ GHCB_SET_VALID(ghcb, field) \
+ (ghcb)->save.field = value; \
+ }
+
+#define DEFINE_GHCB_ACCESSORS(field) \
+ static inline bool ghcb_is_valid_##field(const struct ghcb *ghcb) \
+ { \
+ DEFINE_GHCB_INDICES(field) \
+ return !!((ghcb)->save.valid_bitmap[byte_idx] \
+ & BIT(bit_idx)); \
+ } \
+ \
+ static inline void \
+ ghcb_set_##field(struct ghcb...
2020 Aug 05
0
[PATCH v3 26/38] virtio_config: LE config space accessors
...), \
+ __le16: le16_to_cpu(x), \
+ __le32: le32_to_cpu(x), \
+ __le64: le64_to_cpu(x) \
+ )
+
+#define virtio_cpu_to_le(x, m) \
+ _Generic((m), \
+ __u8: (x), \
+ __le16: cpu_to_le16(x), \
+ __le32: cpu_to_le32(x), \
+ __le64: cpu_to_le64(x) \
+ )
+
+/* LE (e.g. modern) Config space accessors. */
+#define virtio_cread_le(vdev, structname, member, ptr) \
+ do { \
+ typeof(((structname*)0)->member) virtio_cread_v; \
+ \
+ might_sleep(); \
+ /* Sanity check: must match the member's type */ \
+ typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
+...
2020 Aug 05
1
[PATCH v3 31/38] virtio_fs: convert to LE accessors
Virtio fs is modern-only. Use LE accessors for config space.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/fuse/virtio_fs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 4c4ef5d69298..104f35de5270 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/v...
2020 Aug 05
1
[PATCH v3 34/38] drm/virtio: convert to LE accessors
Virtgpu is modern-only. Use LE accessors for config space.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/gpu/drm/virtio/virtgpu_kms.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 0a5c8cf409f...
2020 Aug 24
0
[PATCH v6 03/76] KVM: SVM: Add GHCB Accessor functions
...86/include/asm/svm.h
@@ -341,4 +341,47 @@ struct __attribute__ ((__packed__)) vmcb {
#define SVM_CR0_SELECTIVE_MASK (X86_CR0_TS | X86_CR0_MP)
+/* GHCB Accessor functions */
+
+#define GHCB_BITMAP_IDX(field) \
+ (offsetof(struct vmcb_save_area, field) / sizeof(u64))
+
+#define DEFINE_GHCB_ACCESSORS(field) \
+ static inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \
+ { \
+ return test_bit(GHCB_BITMAP_IDX(field), \
+ (unsigned long *)&ghcb->save.valid_bitmap); \
+ } \
+ \
+ static inline void ghcb_set_##field(struct ghcb *ghcb, u64 value...