int charset_conv::pop_end(acl::string* out, size_t max /* = 0 */) { if (m_pBuf == NULL) { logger_error("call push_pop first"); return (-1); } update_finish(m_pBuf); if (out == NULL) { m_pBuf->clear(); return (0); } size_t n = m_pBuf->length(); if (n == 0) return (0); if (max > 0 && n > max) n = max; out->append(m_pBuf->c_str(), m_pBuf->length()); m_pBuf->clear(); return (n); }
static int wait_for_update(struct alpha_pll_clk *pll) { int count; for (count = WAIT_MAX_LOOPS; count > 0; count--) { if (update_finish(pll)) break; udelay(1); } if (!count) { pr_err("%s didn't lock after enabling it!\n", pll->c.dbg_name); return -EINVAL; } return 0; }
void update_finalize(pixel *vid_buf) { if (!update_flag) return; info_box(vid_buf, "Finalizing update..."); if (last_major>SAVE_VERSION || (last_major==SAVE_VERSION && last_minor>=MINOR_VERSION)) { update_cleanup(); error_ui(vid_buf, 0, "Update failed - try downloading a new version."); } else { if (update_finish()) error_ui(vid_buf, 0, "Update failed - try downloading a new version."); else info_ui(vid_buf, "Update success", "You have successfully updated the Powder Toy!"); } update_flag = 0; }
bool charset_conv::convert(const char* fromCharset, const char* toCharset, const char* in, size_t n, acl::string* out) { if (fromCharset == NULL || toCharset == NULL || in == NULL || n == 0 || out == NULL) { m_errmsg = "params invalid"; return (false); } if (update_begin(fromCharset, toCharset) == false) { reset(); return (false); } if (update(in, n, out) == false) { reset(); return (false); } update_finish(out); return (true); }
gint suncalc_timeout_cb (gpointer data) { WeatherInfo *info = ((MateWeatherApplet *)data)->mateweather_info; update_finish(info, data); return 0; /* Do not repeat timeout (will be re-set by update_finish) */ }
void update_cleanup(void) { #ifdef WIN32 update_finish(); #endif }