Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'factor_in_actions' into 'master'
[simgrid.git] / include / xbt / string.hpp
index 87ea38383e69b09c8ff266802469ed9eb3355964..c23e6f0b6cfe2a290f15c2f6c4daaf136710fbb4 100644 (file)
@@ -31,13 +31,13 @@ namespace xbt {
  *
  * @ingroup XBT_str
  */
-XBT_PUBLIC std::string string_printf(const char* fmt, ...);
+XBT_PUBLIC std::string string_printf(const char* fmt, ...) XBT_ATTRIB_PRINTF(1, 2);
 
 /** Create a C++ string from a C-style format
  *
  * @ingroup XBT_str
  */
-XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap);
+XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
 
 #if SIMGRID_HAVE_MC
 
@@ -145,7 +145,7 @@ public:
   // Capacity
   size_t size() const { return str.len; }
   size_t length() const { return str.len; }
-  bool empty() const { return str.len != 0; }
+  bool empty() const { return str.len == 0; }
   void shrink_to_fit() { /* Being there, but doing nothing */}
 
   // Element access