Skip to content

Commit

Permalink
Remove some more old NSI descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
GrieferAtWork committed Dec 8, 2024
1 parent e7cac22 commit 5fda7f4
Show file tree
Hide file tree
Showing 20 changed files with 478 additions and 1,316 deletions.
8 changes: 0 additions & 8 deletions include/deemon/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -4245,10 +4245,6 @@ DeeType_InheritOperator(DeeTypeObject *__restrict self, Dee_operator_t name);
* operator has been inherited implicitly from a base-type of `self'. */
DFUNDEF ATTR_PURE WUNUSED NONNULL((1)) bool DCALL
DeeType_HasPrivateOperator(DeeTypeObject *__restrict self, Dee_operator_t name);
DFUNDEF ATTR_PURE WUNUSED NONNULL((1)) bool DCALL /* TODO: Deprecated */
DeeType_HasPrivateNSI(DeeTypeObject const *__restrict self);
DFUNDEF ATTR_PURE WUNUSED NONNULL((1)) bool DCALL /* TODO: Deprecated */
DeeType_HasPrivateNII(DeeTypeObject const *__restrict self);

/* Return the type from `self' inherited its operator `name'.
* If `name' wasn't inherited, or isn't defined, simply re-return `self'.
Expand Down Expand Up @@ -4297,8 +4293,6 @@ INTDEF NONNULL((1)) bool DCALL DeeType_InheritSetItem(DeeTypeObject *__restrict
INTDEF NONNULL((1)) bool DCALL DeeType_InheritGetRange(DeeTypeObject *__restrict self); /* tp_getrange, tp_getrange_index, tp_getrange_index_n */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritDelRange(DeeTypeObject *__restrict self); /* tp_delrange, tp_delrange_index, tp_delrange_index_n */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritSetRange(DeeTypeObject *__restrict self); /* tp_setrange, tp_setrange_index, tp_setrange_index_n */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritNSI(DeeTypeObject *__restrict self); /* tp_nsi */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritNII(DeeTypeObject *__restrict self); /* tp_nii */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritWith(DeeTypeObject *__restrict self); /* tp_enter, tp_leave */
INTDEF NONNULL((1)) bool DCALL DeeType_InheritBuffer(DeeTypeObject *__restrict self); /* tp_getbuf, tp_putbuf, tp_buffer_flags */
#else /* CONFIG_BUILDING_DEEMON */
Expand Down Expand Up @@ -4332,8 +4326,6 @@ INTDEF NONNULL((1)) bool DCALL DeeType_InheritBuffer(DeeTypeObject *__restrict s
#define DeeType_InheritGetRange(self) DeeType_InheritOperator(self, OPERATOR_GETRANGE)
#define DeeType_InheritDelRange(self) DeeType_InheritOperator(self, OPERATOR_DELRANGE)
#define DeeType_InheritSetRange(self) DeeType_InheritOperator(self, OPERATOR_SETRANGE)
#define DeeType_InheritNSI(self) DeeType_InheritOperator(self, OPERATOR_ITER)
#define DeeType_InheritNII(self) DeeType_InheritOperator(self, OPERATOR_ITERNEXT)
#define DeeType_InheritWith(self) DeeType_InheritOperator(self, OPERATOR_ENTER)
#define DeeType_InheritBuffer(self) DeeType_InheritOperator(self, OPERATOR_GETBUF)
#endif /* !CONFIG_BUILDING_DEEMON */
Expand Down
43 changes: 12 additions & 31 deletions src/deemon/execute/module_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <deemon/error.h>
#include <deemon/int.h>
#include <deemon/map.h>
#include <deemon/method-hints.h>
#include <deemon/module.h>
#include <deemon/none.h>
#include <deemon/object.h>
Expand Down Expand Up @@ -1321,7 +1322,8 @@ modglobals_delitem_index(ModuleGlobals *self, size_t index) {
}

PRIVATE WUNUSED NONNULL((1, 2)) Dee_ssize_t DCALL
modglobals_enumerate_index(ModuleGlobals *__restrict self, Dee_enumerate_index_t proc,
modglobals_enumerate_index(ModuleGlobals *__restrict self,
Dee_enumerate_index_t proc,
void *arg, size_t start, size_t end) {
Dee_ssize_t temp, result = 0;
DREF DeeObject *item;
Expand Down Expand Up @@ -1354,38 +1356,16 @@ modglobals_enumerate_index(ModuleGlobals *__restrict self, Dee_enumerate_index_t
return -1;
}

PRIVATE struct type_nsi tpconst modglobals_nsi = {
/* .nsi_class = */ TYPE_SEQX_CLASS_SEQ,
/* .nsi_flags = */ TYPE_SEQX_FMUTABLE,
{
/* .nsi_seqlike = */ {
/* .nsi_getsize = */ (dfunptr_t)&modglobals_size,
/* .nsi_getsize_fast = */ (dfunptr_t)&modglobals_size,
/* .nsi_getitem = */ (dfunptr_t)&modglobals_getitem_index,
/* .nsi_delitem = */ (dfunptr_t)&modglobals_delitem_index,
/* .nsi_setitem = */ (dfunptr_t)&modglobals_setitem_index,
}
}
};

PRIVATE WUNUSED NONNULL((1)) DREF DeeObject *DCALL
modglobals_xchitem(ModuleGlobals *self, size_t argc,
DeeObject *const *argv, DeeObject *kw) {
size_t index;
DeeObject *value;
if (DeeArg_UnpackKw(argc, argv, kw, kwlist__index_value,
UNPuSIZ "o:xchitem", &index, &value))
goto err;
return modglobals_xchitem_index(self, index, value);
err:
return NULL;
}

PRIVATE struct type_method tpconst modglobals_methods[] = {
TYPE_KWMETHOD(STR_xchitem, &modglobals_xchitem, "(index:?Dint,value)->"),
TYPE_METHOD_HINTREF(seq_xchitem),
TYPE_METHOD_END
};

PRIVATE struct type_method_hint tpconst modglobals_method_hints[] = {
TYPE_METHOD_HINT(seq_xchitem_index, &modglobals_xchitem_index),
TYPE_METHOD_HINT_END
};

PRIVATE struct type_seq modglobals_seq = {
/* .tp_iter = */ NULL,
/* .tp_sizeob = */ NULL,
Expand All @@ -1396,7 +1376,7 @@ PRIVATE struct type_seq modglobals_seq = {
/* .tp_getrange = */ NULL,
/* .tp_delrange = */ NULL,
/* .tp_setrange = */ NULL,
/* .tp_nsi = */ &modglobals_nsi,
/* .tp_nsi = */ NULL,
/* .tp_foreach = */ NULL,
/* .tp_foreach_pair = */ NULL,
/* .tp_enumerate = */ NULL,
Expand Down Expand Up @@ -1463,7 +1443,8 @@ INTERN DeeTypeObject ModuleGlobals_Type = {
/* .tp_members = */ modglobals_members,
/* .tp_class_methods = */ NULL,
/* .tp_class_getsets = */ NULL,
/* .tp_class_members = */ NULL
/* .tp_class_members = */ NULL,
/* .tp_method_hints = */ modglobals_method_hints,
};


Expand Down
4 changes: 2 additions & 2 deletions src/deemon/linker-scripts/link-deemon-gcc-i386-cygwin.def
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,6 @@ EXPORTS
_DeeType_GetOperatorOrigin@8=DeeType_GetOperatorOrigin@8
_DeeType_GetPrivateMethodHint@8=DeeType_GetPrivateMethodHint@8
_DeeType_GetSeqClass@4=DeeType_GetSeqClass@4
_DeeType_HasPrivateNII@4=DeeType_HasPrivateNII@4
_DeeType_HasPrivateNSI@4=DeeType_HasPrivateNSI@4
_DeeType_HasPrivateOperator@8=DeeType_HasPrivateOperator@8
_DeeType_Implements@8=DeeType_Implements@8
_DeeType_InheritOperator@8=DeeType_InheritOperator@8
Expand Down Expand Up @@ -1349,6 +1347,8 @@ EXPORTS
_Dee_shared_rwlock_waitwrite_timed@12=Dee_shared_rwlock_waitwrite_timed@12
_Dee_shared_rwlock_write@4=Dee_shared_rwlock_write@4
_Dee_shared_rwlock_write_timed@12=Dee_shared_rwlock_write_timed@12
_Dee_simple_hashset_insert@8=Dee_simple_hashset_insert@8
_Dee_simple_hashset_with_lock_insert@8=Dee_simple_hashset_with_lock_insert@8
_Dee_type_member_bound@8=Dee_type_member_bound@8
_Dee_type_member_get@8=Dee_type_member_get@8
_Dee_type_member_set@12=Dee_type_member_set@12
Expand Down
4 changes: 2 additions & 2 deletions src/deemon/linker-scripts/link-deemon-msvc-i386-win32.def
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,6 @@ EXPORTS
DeeType_GetOperatorOrigin@8=_DeeType_GetOperatorOrigin@8
DeeType_GetPrivateMethodHint@8=_DeeType_GetPrivateMethodHint@8
DeeType_GetSeqClass@4=_DeeType_GetSeqClass@4
DeeType_HasPrivateNII@4=_DeeType_HasPrivateNII@4
DeeType_HasPrivateNSI@4=_DeeType_HasPrivateNSI@4
DeeType_HasPrivateOperator@8=_DeeType_HasPrivateOperator@8
DeeType_Implements@8=_DeeType_Implements@8
DeeType_InheritOperator@8=_DeeType_InheritOperator@8
Expand Down Expand Up @@ -1349,6 +1347,8 @@ EXPORTS
Dee_shared_rwlock_waitwrite_timed@12=_Dee_shared_rwlock_waitwrite_timed@12
Dee_shared_rwlock_write@4=_Dee_shared_rwlock_write@4
Dee_shared_rwlock_write_timed@12=_Dee_shared_rwlock_write_timed@12
Dee_simple_hashset_insert@8=_Dee_simple_hashset_insert@8
Dee_simple_hashset_with_lock_insert@8=_Dee_simple_hashset_with_lock_insert@8
Dee_type_member_bound@8=_Dee_type_member_bound@8
Dee_type_member_get@8=_Dee_type_member_get@8
Dee_type_member_set@12=_Dee_type_member_set@12
Expand Down
Loading

0 comments on commit 5fda7f4

Please sign in to comment.