Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f782f86e
Commit
f782f86e
authored
Feb 26, 2010
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pushliteral instead of pushstring where possible. Saves a strlen call.
parent
7478dfe4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
modules/misc/lua/libs/misc.c
modules/misc/lua/libs/misc.c
+1
-1
modules/misc/lua/libs/net.c
modules/misc/lua/libs/net.c
+8
-8
modules/misc/lua/libs/objects.c
modules/misc/lua/libs/objects.c
+1
-1
modules/misc/lua/libs/playlist.c
modules/misc/lua/libs/playlist.c
+4
-4
modules/misc/lua/libs/sd.c
modules/misc/lua/libs/sd.c
+2
-2
modules/misc/lua/libs/variables.c
modules/misc/lua/libs/variables.c
+1
-1
No files found.
modules/misc/lua/libs/misc.c
View file @
f782f86e
...
...
@@ -90,7 +90,7 @@ static int vlclua_version( lua_State *L )
*****************************************************************************/
static
int
vlclua_copyright
(
lua_State
*
L
)
{
lua_push
string
(
L
,
COPYRIGHT_MESSAGE
);
lua_push
literal
(
L
,
COPYRIGHT_MESSAGE
);
return
1
;
}
...
...
modules/misc/lua/libs/net.c
View file @
f782f86e
...
...
@@ -263,31 +263,31 @@ static int vlclua_stat( lua_State *L )
//return luaL_error( L, "Couldn't stat %s.", psz_path );
lua_newtable
(
L
);
if
(
S_ISREG
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"file"
);
lua_push
literal
(
L
,
"file"
);
else
if
(
S_ISDIR
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"dir"
);
lua_push
literal
(
L
,
"dir"
);
#ifdef S_ISCHR
else
if
(
S_ISCHR
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"character device"
);
lua_push
literal
(
L
,
"character device"
);
#endif
#ifdef S_ISBLK
else
if
(
S_ISBLK
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"block device"
);
lua_push
literal
(
L
,
"block device"
);
#endif
#ifdef S_ISFIFO
else
if
(
S_ISFIFO
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"fifo"
);
lua_push
literal
(
L
,
"fifo"
);
#endif
#ifdef S_ISLNK
else
if
(
S_ISLNK
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"symbolic link"
);
lua_push
literal
(
L
,
"symbolic link"
);
#endif
#ifdef S_ISSOCK
else
if
(
S_ISSOCK
(
s
.
st_mode
)
)
lua_push
string
(
L
,
"socket"
);
lua_push
literal
(
L
,
"socket"
);
#endif
else
lua_push
string
(
L
,
"unknown"
);
lua_push
literal
(
L
,
"unknown"
);
lua_setfield
(
L
,
-
2
,
"type"
);
lua_pushinteger
(
L
,
s
.
st_mode
);
lua_setfield
(
L
,
-
2
,
"mode"
);
...
...
modules/misc/lua/libs/objects.c
View file @
f782f86e
...
...
@@ -61,7 +61,7 @@ int __vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
if
(
luaL_newmetatable
(
L
,
"vlc_object"
)
)
{
/* Hide the metatable */
lua_push
string
(
L
,
"none of your business"
);
lua_push
literal
(
L
,
"none of your business"
);
lua_setfield
(
L
,
-
2
,
"__metatable"
);
if
(
pf_gc
)
/* FIXME */
{
...
...
modules/misc/lua/libs/playlist.c
View file @
f782f86e
...
...
@@ -338,16 +338,16 @@ static int vlclua_playlist_status( lua_State *L )
switch
(
playlist_Status
(
p_playlist
)
)
{
case
PLAYLIST_STOPPED
:
lua_push
string
(
L
,
"stopped"
);
lua_push
literal
(
L
,
"stopped"
);
break
;
case
PLAYLIST_RUNNING
:
lua_push
string
(
L
,
"playing"
);
lua_push
literal
(
L
,
"playing"
);
break
;
case
PLAYLIST_PAUSED
:
lua_push
string
(
L
,
"paused"
);
lua_push
literal
(
L
,
"paused"
);
break
;
default:
lua_push
string
(
L
,
"unknown"
);
lua_push
literal
(
L
,
"unknown"
);
break
;
}
PL_UNLOCK
;
...
...
modules/misc/lua/libs/sd.c
View file @
f782f86e
...
...
@@ -185,7 +185,7 @@ static int vlclua_sd_add_item( lua_State *L )
*
udata
=
p_input
;
if
(
luaL_newmetatable
(
L
,
"input_item_t"
)
)
{
lua_push
string
(
L
,
"none of your business"
);
lua_push
literal
(
L
,
"none of your business"
);
lua_setfield
(
L
,
-
2
,
"__metatable"
);
}
lua_setmetatable
(
L
,
-
2
);
...
...
@@ -250,7 +250,7 @@ static int vlclua_node_add_subitem( lua_State *L )
*
udata
=
p_input
;
if
(
luaL_newmetatable
(
L
,
"input_item_t"
)
)
{
lua_push
string
(
L
,
"none of your business"
);
lua_push
literal
(
L
,
"none of your business"
);
lua_setfield
(
L
,
-
2
,
"__metatable"
);
}
lua_setmetatable
(
L
,
-
2
);
...
...
modules/misc/lua/libs/variables.c
View file @
f782f86e
...
...
@@ -224,7 +224,7 @@ static int vlclua_command( lua_State *L )
}
else
{
lua_push
string
(
L
,
""
);
lua_push
literal
(
L
,
""
);
}
return
vlclua_push_ret
(
L
,
ret
)
+
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment