}
/* Determine callback function. */
- monitor_object = XIL ((intptr_t) monitor);
+ monitor_object = make_pointer_integer (monitor);
eassert (INTEGERP (monitor_object));
watch_object = assq_no_quit (monitor_object, watch_list);
will be reported only in case of the 'moved' event. */)
(Lisp_Object file, Lisp_Object flags, Lisp_Object callback)
{
- Lisp_Object watch_descriptor, watch_object;
+ Lisp_Object watch_object;
GFile *gfile;
GFileMonitor *monitor;
GFileMonitorFlags gflags = G_FILE_MONITOR_NONE;
if (! monitor)
xsignal2 (Qfile_notify_error, build_string ("Cannot watch file"), file);
- /* On all known glib platforms, converting MONITOR directly to a
- Lisp_Object value results is a Lisp integer, which is safe. This
- assumption is dicey, though, so check it now. */
- watch_descriptor = XIL ((intptr_t) monitor);
+ Lisp_Object watch_descriptor = make_pointer_integer (monitor);
+
+ /* Check the dicey assumption that make_pointer_integer is safe. */
if (! INTEGERP (watch_descriptor))
{
g_object_unref (monitor);
WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
(Lisp_Object watch_descriptor)
{
- intptr_t int_monitor;
- GFileMonitor *monitor;
Lisp_Object watch_object = assq_no_quit (watch_descriptor, watch_list);
if (! CONSP (watch_object))
watch_descriptor);
eassert (INTEGERP (watch_descriptor));
- int_monitor = XLI (watch_descriptor);
- monitor = (GFileMonitor *) int_monitor;
+ GFileMonitor *monitor = XINTPTR (watch_descriptor);
if (!g_file_monitor_cancel (monitor))
xsignal2 (Qfile_notify_error, build_string ("Could not rm watch"),
watch_descriptor);
void
syms_of_gfilenotify (void)
{
- DEFSYM (Qgfile_add_watch, "gfile-add-watch");
defsubr (&Sgfile_add_watch);
-
- DEFSYM (Qgfile_rm_watch, "gfile-rm-watch");
defsubr (&Sgfile_rm_watch);
/* Filter objects. */