Print this page
3165 correct pointer to integer conversion in Privilege.xs
   1 /*
   2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 
   5 /* Solaris includes. */
   6 #include <priv.h>
   7 #include <ctype.h>
   8 
   9 /* Perl includes. */
  10 #include "EXTERN.h"
  11 #include "perl.h"
  12 #include "XSUB.h"
  13 
  14 #define IVCONST(s, c)   newCONSTSUB(s, #c, newSViv((int)c));
  15 #define POFF            (sizeof ("PRIV_") - 1)
  16 
  17 #define RETPRIVSET(set)         \
  18         ST(0) = sv_newmortal();                                         \
  19         sv_setref_pv(ST(0), "Sun::Solaris::Privilege::PrivsetPtr",      \
  20             (void*)(set));                                              \
  21         SvREADONLY_on(SvRV(ST(0)))
  22 
  23 typedef int sysret;
  24 
  25 typedef priv_set_t Sun__Solaris__Privilege__Privset;
  26 
  27 static priv_set_t *
  28 dupset(const priv_set_t *s)
  29 {
  30         priv_set_t *new = priv_allocset();
  31         if (new == NULL)
  32                 return (NULL);
  33 
  34         priv_copyset(s, new);


   1 /*
   2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 
   5 /* Solaris includes. */
   6 #include <priv.h>
   7 #include <ctype.h>
   8 
   9 /* Perl includes. */
  10 #include "EXTERN.h"
  11 #include "perl.h"
  12 #include "XSUB.h"
  13 
  14 #define IVCONST(s, c)   newCONSTSUB(s, #c, newSViv((int)(intptr_t)c));
  15 #define POFF            (sizeof ("PRIV_") - 1)
  16 
  17 #define RETPRIVSET(set)         \
  18         ST(0) = sv_newmortal();                                         \
  19         sv_setref_pv(ST(0), "Sun::Solaris::Privilege::PrivsetPtr",      \
  20             (void*)(set));                                              \
  21         SvREADONLY_on(SvRV(ST(0)))
  22 
  23 typedef int sysret;
  24 
  25 typedef priv_set_t Sun__Solaris__Privilege__Privset;
  26 
  27 static priv_set_t *
  28 dupset(const priv_set_t *s)
  29 {
  30         priv_set_t *new = priv_allocset();
  31         if (new == NULL)
  32                 return (NULL);
  33 
  34         priv_copyset(s, new);