Cleanup: use the naming convention in py_capi_utils
And use inline functions instead of preprocessor directives.
This commit is contained in:
		@@ -91,17 +91,11 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args,
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		bool format_error = pybuffer.itemsize != 4;
 | 
			
		||||
		if (pybuffer.itemsize != 4 ||
 | 
			
		||||
		    PyC_Formatstr_is_float(PyC_Formatstr_get(pybuffer.format)))
 | 
			
		||||
		{
 | 
			
		||||
			char format = FORMAT_STR_GET(pybuffer.format);
 | 
			
		||||
			if (FORMAT_STR_IS_FLOAT(format)) {
 | 
			
		||||
				format_error = true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (format_error) {
 | 
			
		||||
			PyErr_Format(PyExc_ValueError,
 | 
			
		||||
			        "Each index must be an integer value with 4 bytes in size");
 | 
			
		||||
			             "Each index must be an 4-bytes integer value");
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user