A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Perl/perl5/commit/7b92fe48f0def2bea3db4aa70f352ccf9d83b43a below:

maintain boolean values · Perl/perl5@7b92fe4 · GitHub

174 174

#define SX_SVUNDEF_ELEM C(31) /* array element set to &PL_sv_undef */

175 175

#define SX_REGEXP C(32) /* Regexp */

176 176

#define SX_LOBJECT C(33) /* Large object: string, array or hash (size >2G) */

177 -

#define SX_LAST C(34) /* invalid. marker only */

177 +

#define SX_BOOLEAN_TRUE C(34) /* Boolean true */

178 +

#define SX_BOOLEAN_FALSE C(35) /* Boolean false */

179 +

#define SX_LAST C(36) /* invalid. marker only */

178 180 179 181

/*

180 182

* Those are only used to retrieve "old" pre-0.6 binary images.

@@ -973,7 +975,7 @@ static const char byteorderstr_56[] = {BYTEORDER_BYTES_56, 0};

973 975

#endif

974 976 975 977

#define STORABLE_BIN_MAJOR 2 /* Binary major "version" */

976 -

#define STORABLE_BIN_MINOR 11 /* Binary minor "version" */

978 +

#define STORABLE_BIN_MINOR 12 /* Binary minor "version" */

977 979 978 980

#if !defined (SvVOK)

979 981

/*

@@ -1452,6 +1454,8 @@ static const sv_retrieve_t sv_old_retrieve[] = {

1452 1454

(sv_retrieve_t)retrieve_other, /* SX_SVUNDEF_ELEM not supported */

1453 1455

(sv_retrieve_t)retrieve_other, /* SX_REGEXP */

1454 1456

(sv_retrieve_t)retrieve_other, /* SX_LOBJECT not supported */

1457 +

(sv_retrieve_t)retrieve_other, /* SX_BOOLEAN_TRUE not supported */

1458 +

(sv_retrieve_t)retrieve_other, /* SX_BOOLEAN_FALSE not supported */

1455 1459

(sv_retrieve_t)retrieve_other, /* SX_LAST */

1456 1460

};

1457 1461

@@ -1475,6 +1479,8 @@ static SV *retrieve_weakoverloaded(pTHX_ stcxt_t *cxt, const char *cname);

1475 1479

static SV *retrieve_vstring(pTHX_ stcxt_t *cxt, const char *cname);

1476 1480

static SV *retrieve_lvstring(pTHX_ stcxt_t *cxt, const char *cname);

1477 1481

static SV *retrieve_svundef_elem(pTHX_ stcxt_t *cxt, const char *cname);

1482 +

static SV *retrieve_boolean_true(pTHX_ stcxt_t *cxt, const char *cname);

1483 +

static SV *retrieve_boolean_false(pTHX_ stcxt_t *cxt, const char *cname);

1478 1484 1479 1485

static const sv_retrieve_t sv_retrieve[] = {

1480 1486

0, /* SX_OBJECT -- entry unused dynamically */

@@ -1511,6 +1517,8 @@ static const sv_retrieve_t sv_retrieve[] = {

1511 1517

(sv_retrieve_t)retrieve_svundef_elem,/* SX_SVUNDEF_ELEM */

1512 1518

(sv_retrieve_t)retrieve_regexp, /* SX_REGEXP */

1513 1519

(sv_retrieve_t)retrieve_lobject, /* SX_LOBJECT */

1520 +

(sv_retrieve_t)retrieve_boolean_true, /* SX_BOOLEAN_TRUE */

1521 +

(sv_retrieve_t)retrieve_boolean_false, /* SX_BOOLEAN_FALSE */

1514 1522

(sv_retrieve_t)retrieve_other, /* SX_LAST */

1515 1523

};

1516 1524

@@ -2452,6 +2460,16 @@ static int store_scalar(pTHX_ stcxt_t *cxt, SV *sv)

2452 2460

pv = SvPV(sv, len); /* We know it's SvPOK */

2453 2461

goto string; /* Share code below */

2454 2462

}

2463 +

#ifdef SvIsBOOL

2464 +

} else if (SvIsBOOL(sv)) {

2465 +

TRACEME(("mortal boolean"));

2466 +

if (SvTRUE_nomg_NN(sv)) {

2467 +

PUTMARK(SX_BOOLEAN_TRUE);

2468 +

}

2469 +

else {

2470 +

PUTMARK(SX_BOOLEAN_FALSE);

2471 +

}

2472 +

#endif

2455 2473

} else if (flags & SVf_POK) {

2456 2474

/* public string - go direct to string read. */

2457 2475

goto string_readlen;

@@ -5880,6 +5898,50 @@ static SV *retrieve_integer(pTHX_ stcxt_t *cxt, const char *cname)

5880 5898

return sv;

5881 5899

}

5882 5900 5901 +

/*

5902 +

* retrieve_boolean_true

5903 +

*

5904 +

* Retrieve boolean true copy.

5905 +

*/

5906 +

static SV *retrieve_boolean_true(pTHX_ stcxt_t *cxt, const char *cname)

5907 +

{

5908 +

SV *sv;

5909 +

HV *stash;

5910 + 5911 +

TRACEME(("retrieve_boolean_true (#%d)", (int)cxt->tagnum));

5912 + 5913 +

sv = newSVsv(&PL_sv_yes);

5914 +

stash = cname ? gv_stashpv(cname, GV_ADD) : 0;

5915 +

SEEN_NN(sv, stash, 0); /* Associate this new scalar with tag "tagnum" */

5916 + 5917 +

TRACEME(("boolean true"));

5918 +

TRACEME(("ok (retrieve_boolean_true at 0x%" UVxf ")", PTR2UV(sv)));

5919 + 5920 +

return sv;

5921 +

}

5922 + 5923 +

/*

5924 +

* retrieve_boolean_false

5925 +

*

5926 +

* Retrieve boolean false copy.

5927 +

*/

5928 +

static SV *retrieve_boolean_false(pTHX_ stcxt_t *cxt, const char *cname)

5929 +

{

5930 +

SV *sv;

5931 +

HV *stash;

5932 + 5933 +

TRACEME(("retrieve_boolean_true (#%d)", (int)cxt->tagnum));

5934 + 5935 +

sv = newSVsv(&PL_sv_no);

5936 +

stash = cname ? gv_stashpv(cname, GV_ADD) : 0;

5937 +

SEEN_NN(sv, stash, 0); /* Associate this new scalar with tag "tagnum" */

5938 + 5939 +

TRACEME(("boolean false"));

5940 +

TRACEME(("ok (retrieve_boolean_false at 0x%" UVxf ")", PTR2UV(sv)));

5941 + 5942 +

return sv;

5943 +

}

5944 + 5883 5945

/*

5884 5946

* retrieve_lobject

5885 5947

*


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4