Browse Source

Rename vlc_error() to vlc_error_string()

As a sort of VLC equivalent for strerror(), it is tempting to call it
vlc_strerror()... but that is already taken for converting actual
standard error codes to strings.
pull/85/head
Rémi Denis-Courmont 7 years ago
parent
commit
3e8986472a
  1. 2
      include/vlc_common.h
  2. 4
      modules/control/oldrc.c
  3. 2
      modules/lua/libs/misc.c
  4. 2
      src/libvlccore.sym
  5. 4
      src/misc/error.c

2
include/vlc_common.h

@ -945,7 +945,7 @@ static inline bool mul_overflow(unsigned long long a, unsigned long long b,
#define EMPTY_STR(str) (!str || !*str)
VLC_API char const * vlc_error( int ) VLC_USED;
VLC_API const char *vlc_error_string(int) VLC_USED;
#include <vlc_arrays.h>

4
modules/control/oldrc.c

@ -645,7 +645,7 @@ static void *Run( void *data )
else
i_ret = var_SetString( p_intf, psz_cmd, psz_arg );
msg_rc( "%s: returned %i (%s)",
psz_cmd, i_ret, vlc_error( i_ret ) );
psz_cmd, i_ret, vlc_error_string( i_ret ) );
}
/* Or maybe it's a global command */
else if( var_Type( vlc, psz_cmd ) & VLC_VAR_ISCOMMAND )
@ -661,7 +661,7 @@ static void *Run( void *data )
if( i_ret != 0 )
{
msg_rc( "%s: returned %i (%s)",
psz_cmd, i_ret, vlc_error( i_ret ) );
psz_cmd, i_ret, vlc_error_string( i_ret ) );
}
}
else if( !strcmp( psz_cmd, "logout" ) )

2
modules/lua/libs/misc.c

@ -84,7 +84,7 @@ vlc_object_t * vlclua_get_this( lua_State *L )
int vlclua_push_ret( lua_State *L, int i_error )
{
lua_pushnumber( L, i_error );
lua_pushstring( L, vlc_error( i_error ) );
lua_pushstring( L, vlc_error_string( i_error ) );
return 2;
}

2
src/libvlccore.sym

@ -573,7 +573,7 @@ vlc_sem_wait
vlc_control_cancel
vlc_GetCPUCount
vlc_CPU
vlc_error
vlc_error_string
vlc_event_attach
vlc_event_detach
vlc_filenamecmp

4
src/misc/error.c

@ -30,12 +30,12 @@
#include <vlc_common.h>
/*****************************************************************************
* vlc_error: strerror() equivalent
* vlc_error_string: strerror() equivalent
*****************************************************************************
* This function returns a string describing the error code passed in the
* argument. A list of all errors can be found in include/vlc_common.h.
*****************************************************************************/
char const * vlc_error ( int i_err )
const char *vlc_error_string(int i_err)
{
switch( i_err )
{

Loading…
Cancel
Save