Branch: Tag:

2014-08-15

2014-08-15 20:21:17 by Martin Nilsson <nilsson@opera.com>

Less zero_type.

528:   //! through the generic SQL-interface.   int setcachedepth(void|int newdepth)   { int olddepth=cachedepth; -  if(!zero_type(newdepth) && newdepth>=0) +  if(!undefinedp(newdepth) && newdepth>=0)    cachedepth=newdepth;    return olddepth;   }
544:   //! through the generic SQL-interface.   int settimeout(void|int newtimeout)   { int oldtimeout=timeout; -  if(!zero_type(newtimeout) && newtimeout>0) +  if(!undefinedp(newtimeout) && newtimeout>0)    timeout=newtimeout;    return oldtimeout;   }
560:   //! through the generic SQL-interface.   int setportalbuffersize(void|int newportalbuffersize)   { int oldportalbuffersize=portalbuffersize; -  if(!zero_type(newportalbuffersize) && newportalbuffersize>0) +  if(!undefinedp(newportalbuffersize) && newportalbuffersize>0)    portalbuffersize=newportalbuffersize;    return oldportalbuffersize;   }
576:   //! through the generic SQL-interface.   int setfetchlimit(void|int newfetchlimit)   { int oldfetchlimit=_fetchlimit; -  if(!zero_type(newfetchlimit) && newfetchlimit>=0) +  if(!undefinedp(newfetchlimit) && newfetchlimit>=0)    _fetchlimit=newfetchlimit;    return oldfetchlimit;   }
1083:    case noerror:    break;    } -  if(zero_type(waitforstate)) +  if(undefinedp(waitforstate))    break;    }    PD("Found state %O\n",_mstate);
1150:    plugbuf+=({"user\0",user,"\0"});    if(database)    plugbuf+=({"database\0",database,"\0"}); -  options->reconnect=zero_type(options->reconnect) || options->reconnect; +  options->reconnect=undefinedp(options->reconnect) || options->reconnect;    foreach((options+_runtimeparameter)    -(<"use_ssl","force_ssl","cache_autoprepared_statements","reconnect",    "text_query","is_superuser","server_encoding","server_version",
1790:    prepstmtused++, preparedname=tp->preparedname;    else if((tstart=tp->trun)    && tp->tparse*FACTORPLAN>=tstart -  && (zero_type(options->cache_autoprepared_statements) +  && (undefinedp(options->cache_autoprepared_statements)    || options->cache_autoprepared_statements))    preparedname=PREPSTMTPREFIX+(string)pstmtcount++;    }
1883:    plugbuf+=({_c.plugint16(oidformat(textbin))});    plugbuf+=({_c.plugint16(sizeof(paramValues))});    foreach(paramValues;int i;mixed value) -  { if(zero_type(value)) +  { if(undefinedp(value))    plugbuf+=({_c.plugint32(-1)}); // NULL    else if(stringp(value) && !sizeof(value))    { int k=0;