MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathCacheNewFloat

Function xmlXPathCacheNewFloat

ThirdParty/libxml2/vtklibxml2/xpath.c:1904–1928  ·  view source on GitHub ↗

* xmlXPathCacheNewFloat: * @pctxt the XPath context * @val: the double value * * This is the cached version of xmlXPathNewFloat(). * Acquires an xmlXPathObjectPtr of type double and of value @val * * Returns the created or reused object. */

Source from the content-addressed store, hash-verified

1902 * Returns the created or reused object.
1903 */
1904static xmlXPathObjectPtr
1905xmlXPathCacheNewFloat(xmlXPathParserContextPtr pctxt, double val)
1906{
1907 xmlXPathObjectPtr ret;
1908 xmlXPathContextPtr ctxt = pctxt->context;
1909
1910 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
1911 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
1912
1913 if (cache->miscObjs != NULL) {
1914 ret = cache->miscObjs;
1915 cache->miscObjs = (void *) ret->stringval;
1916 cache->numMisc -= 1;
1917 ret->stringval = NULL;
1918 ret->type = XPATH_NUMBER;
1919 ret->floatval = val;
1920 return(ret);
1921 }
1922 }
1923
1924 ret = xmlXPathNewFloat(val);
1925 if (ret == NULL)
1926 xmlXPathPErrMemory(pctxt);
1927 return(ret);
1928}
1929
1930/**
1931 * xmlXPathCacheObjectCopy:

Callers 8

xmlXPathCacheObjectCopyFunction · 0.85
xmlXPathLastFunctionFunction · 0.85
xmlXPathPositionFunctionFunction · 0.85
xmlXPathCountFunctionFunction · 0.85
xmlXPathNumberFunctionFunction · 0.85
xmlXPathSumFunctionFunction · 0.85
xmlXPathCompNumberFunction · 0.85

Calls 2

xmlXPathNewFloatFunction · 0.85
xmlXPathPErrMemoryFunction · 0.85

Tested by

no test coverage detected